Introduction

This is my blog of programming, I take notes and leave codes of computer science problems I solved here. Be my guest to comment :)

Tuesday, November 6, 2012

uva 11547 - Automatic Answer


Problem link
#include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;

int main() {
 int ntest,n;
 cin >> ntest;
 for (int test=1; test<=ntest; test++)
 {
  cin >> n;
  int result = (n*63 + 7492)*5 - 498;
  result /= 10;
  cout << abs(result%10) << endl;
 }
 return 0;
}

No comments:

Post a Comment