天勤OJ 题目1369: 加法等式
无。
每行输出3个数,分别表示abc的值,用一个空格隔开。
无
无
*** 提示已隐藏,点击上方 [+] 可显示 ***
北京理工大学计算机专业2000年研究生复试上机试题
/********************************** 日期:2013-2-14* 作者:SJF0115* 题号: 天勤OJ 题目1369: 加法等式* 来源:http://ac.jobdu.com/problem.php?pid=1125* 结果:AC* 来源:http://acmclub.com/problem.php?id=1369* 总结:这么水!!!abc能直接算出 c = 1 或者 c = 6(c = 6不满足题意) **********************************/#include<stdio.h>#include<string.h>#include<stdlib.h>int main(){ int a,b,c; for(int i=100; i<1000; i++) { a = i / 100; b = i / 10 % 10; c = i % 10;//abc + bcc = 532 if((i + b*100 + c*10 + c) == 532) {printf("%d %d %d\n",a,b,c); } } return 0;}