02 2021 档案
摘要:例题部分 1、输入两个学生a和b成绩,输出其中高的成绩。 #include <stdio.h> int main() { float a,b,max; printf("Please input the score of ab: \n"); scanf("%f,%f",&a,&b); if(a>b){
阅读全文
摘要:1、putchar函数 #include <stdio.h> int main() { char a,b,c; a='B',b='O',c='Y'; putchar(a); // B putchar(b); // O putchar(c); // Y putchar('\n'); return 0;
阅读全文
摘要:1、鸡兔同笼 设x代表鸡的数量,y代表兔的数量,总头数为 h,总脚数为 f ,根据代数公式,得出下列公式: ① x+y=h; ② 2x+4y=f. 解方程:② - ① × 2 得:y=(f-2h)/ 2 x=h-y #include <stdio.h> int main() { int x,y,h,
阅读全文
摘要:1、输入两个数计算和、差、积、商 1 #include <stdio.h> 2 int main() 3 { 4 float a,b,sum,sub,mul,div; 5 printf("请输入两个数:\n"); 6 scanf("%f,%f",&a,&b); 7 8 sum=a+b; 9 sub=
阅读全文

浙公网安备 33010602011771号