#UVa:11547-Automatic Answer

灆洢 2014-12-26 00:28:50

照著題目之公式算出答案即可。

C++(0.019)

/*******************************************************/
/* UVa 11547 Automatic Answer                          */
/* Author: Maplewing [at] knightzone.studio            */
/* Version: 2014/12/26                                 */
/*******************************************************/
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main(){
  int t;
  while( scanf("%d", &t) != EOF ){
    for( int i = 0 ; i < t ; ++i ){
      int n;
      scanf("%d", &n);

      printf("%d\n", abs(((n * 567 / 9 + 7492) * 235 / 47 - 498) / 10 % 10 ));
    }
  }

  return 0;
}

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步瞭解 Akismet 如何處理網站訪客的留言資料