摘要:
编写程序,定义两个整形变量,赋值并输出 #include<stdio.h> main() { int a=5; int b=7; printf("%d %d\n",a,b); } 2.编写程序,定义一个单精度和一个双精度的变量,赋值并输出。 #include<stdio.h> main() { fl 阅读全文
posted @ 2021-11-25 16:50
zx。
阅读(31)
评论(0)
推荐(0)
摘要:
1.编写程序,输出“我爱学习C语言!”。 1 2 3 4 5 #include <stdio.h> main() { printf("我爱学习学习C语言!"); } 2.分行输出自己的专业和姓名 1 2 3 4 5 #include <stdio.h> main() { printf("计算机科学与 阅读全文
posted @ 2021-11-25 16:49
zx。
阅读(24)
评论(0)
推荐(0)
摘要:
随机产生一个0-99的数,猜猜看 如果大了 就提示大了点 如果小了 就提示小了点 直到猜对为止 #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int a,b,c; srand((unsigned)time( 阅读全文
posted @ 2021-11-25 12:55
zx。
阅读(65)
评论(0)
推荐(0)
摘要:
1. 定义一个含有8个存储单元的实型数组,从键盘上接收数,然后逆序输出。#include<stdio.h> main() { int m[8]; int i; for(i=0;i<=7;i++) scanf("%d",&m[i]); for(i=7;i>=0;i--) printf("%d",m[i 阅读全文
posted @ 2021-11-25 12:55
zx。
阅读(36)
评论(0)
推荐(0)
摘要:
1. * ** *** **** ***** #include<stdio.h>main(){ int i,j; for(i=1;i<=5;i++){ for(j=1;j<=9-i*2;j++) printf("*"); printf("\n");} } ***** **** *** * #incl 阅读全文
posted @ 2021-11-25 12:54
zx。
阅读(35)
评论(0)
推荐(0)
摘要:
1.猜数字:随机产生一个0-99的数,猜猜看,如果大了, 就提示大了点,如果小了,就提示小了点. 直到猜对为止 #include<stdio.h> #include<stdlib.h> #include<time.h> int main(){ time_t ti; int num,guess; sr 阅读全文
posted @ 2021-11-25 12:53
zx。
阅读(29)
评论(0)
推荐(0)
摘要:
1.编写程序,使用while语句求和sum=1+3+5+…+21 #include<stdio.h> main() { int i=1,sum=0; while(i<=21){ sum+=i; i+=2; } printf("Sum=%d\n",sum); } 2.编写程序,使用while语句求和s 阅读全文
posted @ 2021-11-25 12:52
zx。
阅读(12)
评论(0)
推荐(0)
摘要:
1.编写程序,使用if的多分支结构,将输入的分数mark(0~100整数)转换为相应的等级(90~100为A,80~89为B,70~79为C,60~69为D,0~59为NO PASS!) #include<stdio.h> main() { int mark; printf("输入学生的分数(0-1 阅读全文
posted @ 2021-11-25 12:51
zx。
阅读(49)
评论(0)
推荐(0)
摘要:
第三次作业 1 2 3 4 5 6 7 8 9 10 1. 编写程序,使用scanf()函数接收整型、实型、字符型的变量,并分行依次输出。 #include<stdio.h> main() { int a; float b; char c; scanf("%d %f %c",&a,&b,&c); p 阅读全文
posted @ 2021-11-25 12:50
zx。
阅读(37)
评论(0)
推荐(0)
摘要:
#include<stdio.h> main() { int mark; printf("输入学生的分数(0-100):"); scanf("%d",&mark); switch(mark/10) { case 10: case 9:printf("A\n"); break; case 8:prin 阅读全文
posted @ 2021-11-25 12:48
zx。
阅读(28)
评论(0)
推荐(0)

浙公网安备 33010602011771号