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


ADS

ADS

Sunday, April 9, 2017

UVa 11547 AUTOMATIC ANSWER Solution in C / C++



Source Code

#include<stdio.h>

int main() {
  int t, i, n, ans, a, m;
  while (scanf("%d", & t) == 1) {
    i = 1;
    while (i <= t) {
      scanf("%d", & n);
      a = n * 315 + 36962;
      m = a / 10;
      ans = m % 10;
      if (ans < 0)
        ans = ans / (-1);
      printf("%d\n", ans);
      i++;
    }
  }
  return 0;
}

No comments:

Post a Comment