- 博客(3)
- 收藏
- 关注
原创 编程求200 以内所有素数的和,并输出所有的素数。
#include <stdio.h> #include <cmath> int main() { int i,n,s=0; int c; for(i=2;i<=200;i++) { c=1; for(n=2;n<=(int)sqrt(i);n++) if(i%n==0){ c=0;break;} if(c) ...
2022-03-29 14:52:17 3977 1
原创 自己写过的一道题
如果小张手上有n个空汽水瓶,最多可以换多少瓶汽水喝?3个空瓶子可以换一瓶汽水 #include <stdio.h> #include <math.h> int main() { int n; int s; do { scanf("%d",&n); if(n==0) break; s=n/2; printf("%d\n",s); } while(1); return 0; } ...
2022-03-25 10:03:00 54
原创 第一次发,可能不太好,别喷我
输入 输入数据会有多组数据。每组数据占一行。 每行有两个数字a和b,表示需要构造出阻值为a/b欧姆的电阻。 这里a,b有 1<=a,b<=1018 当a,b都等于0,输入结束,并且这组数据不需要处理。 输出 对于每一组数据,输出只占一行。 每行输出一个数字min,表示最少需要多少个1Ω的电阻可以组合出阻值为a/b欧姆电阻。 样例输入 1 2 2 1 0 0 样例输出 2 ...
2022-03-25 09:34:01 340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人