解题思路:
完全数好像真的很少,,6,28,496,8128,33550336,,目测只会考前四个,,,剩下的估计正常算1s之内跑不完程序,,所以无脑直接输出啊hhhhhhh
注意事项:
出乎意料的,,竟然测试数据有大于8128的hhhhhhhhhh
参考代码:
#include <stdio.h> int main() { int n; while (scanf("%d", &n) != EOF) { if (n >= 6) printf("6 its factors are 1 2 3\n"); if (n >= 28) printf("28 its factors are 1 2 4 7 14\n"); if (n >= 496) printf("496 its factors are 1 2 4 8 16 31 62 124 248\n"); if (n >= 8128) printf("8128 its factors are 1 2 4 8 16 32 64 127 254 508 1016 2032 4064\n"); } return 0; }
0.0分
12 人评分
C二级辅导-公约公倍 (C语言代码)浏览:1282 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:566 |
【C语言训练】求s=a+aa+aaa+aaaa+aa...a的值 (C语言代码)浏览:415 |
WU-格式化数据输出 (C语言代码)浏览:1175 |
用筛法求之N内的素数。 (C语言代码)浏览:466 |
用筛法求之N内的素数。 (C语言代码)浏览:444 |
Cylinder (C语言描述,蓝桥杯)浏览:712 |
星期判断机 (C语言代码)浏览:346 |
2006年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:583 |
简单的a+b (C语言代码)浏览:465 |
ET 2020-04-19 12:46:25 |
辛苦了,没有评论置顶功能,不然可以交易一波