hdu 3953 I'll play a trick on you

 爲什麼說這個題呢。。

因爲它坑爹。。

尼瑪尼瑪尼瑪。。。

罵死你...

我怎麼說減法不對,好一道高精度的大數減法啊!!!!!啊!!!!!!!!

9+9=18;7+2=9;18+9 = 27

懂了嗎?

不懂看最後一組數

說了“Please never doubt the picture”,不聽話......

 

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main()
{
	int T;
	char n[200], m[200];
	int a, b,sum;
	int k = 1, i, j;
	scanf("%d", &T);
	while( T-- )
	{
		scanf("%s %s", &n, &m);
		sum = 0;
		for(i = 0; i < strlen(n); i++)
		{
			sum += n[i] - '0';
		}
		for(j = 0; j < strlen(m); j++)
		{
			sum += m[j] - '0';
		}
		printf("Case %d: %d\n",k,sum);
		k++;
	}
	return 0;
}


 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章