摘要: <1>引入模型:凑硬币 题目条件:用1角,两角,五角的硬币凑出10元金额: (1)#include<stdio.h> int main(){ int x; int one,two,five; scanf("%d",&x); for(one=1;one<x10;one++){ for(two=1;tw 阅读全文
posted @ 2023-11-04 20:51 瑜阳 阅读(21) 评论(0) 推荐(0)
摘要: 嵌套循环 * 以输出0-100之间的素数为例: #include<stdio.h> int main(){ int x; int isprime=1; for(x=2;x<100;x++){ int i; int isprime=1; for(i=2;i<x;i++){ if(x%i= =0){ i 阅读全文
posted @ 2023-11-04 00:57 瑜阳 阅读(28) 评论(0) 推荐(0)