2562.c

来自「pku online judge的一些题目的代码,全部AC的,适合编程初学者以及」· C语言 代码 · 共 24 行

C
24
字号
#include<stdio.h>
int main()
{
	int m,n,tmp,count;
	while(scanf("%d%d",&m,&n),m||n)
	{
		
		for(count=tmp=0;m||n;m/=10,n/=10)
		{
			tmp+=m%10+n%10;
			if(tmp>9)
				count++;
			tmp/=10;
		}
		if(count)
		{
			printf("%d carry ",count);
			puts(count>1?"operations.":"operation.");
		}
		else
			puts("No carry operation.");
	}
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?