“Sometimes it is the people no one can imagine anything of who do the things no one can imagine.” ― Sir Alan Turing


ADS

ADS

Saturday, April 8, 2017

UVa 10300 Ecological Premium Solution in C / C++


Source Code

include < stdio.h >
  int main() {
    long long a, t, n, b, c, i, j, ans;
    while (scanf("%lld", & t) == 1) {
      for (i = 0; i < t; i++) {
        ans = 0;
        scanf("%lld", & n);
        for (j = 0; j < n; j++) {
          scanf("%lld%lld%lld", & a, & b, & c);
          ans += a * c;
        }
        printf("%lld\n", ans);
      }
    }
    return 0;
  }

No comments:

Post a Comment