标签:count 输入 http color lib div 遇到 number amp
part2:
#include <stdio.h> #include <stdlib.h> int main() { int number, max, min, n; n=1; printf("输入第d%个数: ", n); scanf("%d", &number); max = number; min = number; while(n<=4) { n++; printf("输入第d%个数: ", n); scanf("%d", &number); if(max<number) max = number; else if(min>number) min = number; } printf("最大数为: %d\n", max); printf("最小数为: %d\n", min); system("pause"); return 0; }
part3.1
#include<stdio.h> #include<math.h> int main() { int i=0; int count=0; for(i=101;i<=200;i+=2) { int j=0; for(j=2;j<=sqrt(i);j++) { if(i%j==0) { break; } } if(j>sqrt(i)) { printf("%d\n",i); count++; } } printf("\ncount=%d\n",count); return 0; }
part3.2
#include<stdio.h> #include<math.h> int main() { printf("Enter a number:"); int k,i=1; unsigned long m,a=0; scanf("%lu",&m); while(m!=0) { k=m%10; m=m/10; if(k%2==1) { a=a+k*i; i=10*i; } } printf("new number is:%lu",a); return 0; }
实验总结:在写最后一个程序时遇到了不小的困难,看来仍需练习
标签:count 输入 http color lib div 遇到 number amp
原文地址:https://www.cnblogs.com/loosers/p/11863156.html