摘要: 1.定义圆半径,求面积。 public class wan { public static void main(String[] args) { // TODO Auto-generated method stub int r=5; double Π=3.14; System.out.println 阅读全文
posted @ 2023-03-19 20:40 未步乘风 阅读(20) 评论(0) 推荐(0)
摘要: 定义一个含有8个存储单元的实型数组,从键盘上接收数,然后逆序输出 #include<stdio.h> main() { double m[8]; int i; for(i=0;i<=7;i++) scanf("%lf",&m[i]); for(i=7;i>=0;i--) printf("%f",m[ 阅读全文
posted @ 2021-11-23 09:35 未步乘风 阅读(10) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int a,n; srand((unsigned)time(NULL)); a=rand()%100+1; printf("请输入你心里所想的一个数:"); s 阅读全文
posted @ 2021-11-17 15:54 未步乘风 阅读(38) 评论(0) 推荐(0)
摘要: 1.编写程序,输出以下图形 * ******* ** ***** *** *** **** * ***** #include<stdio.h> main(){ int i,j; for(i=1;i<=5;i++) { for(j=1;j<=i;j++){ printf("*"); } printf( 阅读全文
posted @ 2021-11-09 10:37 未步乘风 阅读(18) 评论(0) 推荐(0)
摘要: 10.26作业 1、编写程序,输入一个分数(0——100分)并评出相应等级。 #include<stdio.h> main(){ int mark; printf("请输入学生的分数(0——100)\n"); scanf("%d",&mark); switch(mark/10) { case 10: 阅读全文
posted @ 2021-11-03 18:45 未步乘风 阅读(54) 评论(0) 推荐(0)
摘要: 3.编写程序,判断一个数n是正数还是负数。 #include<stdio.h> main(){ float n; scanf("%f",&n); if(n>0) printf("正数!\n"); else if (n==0) printf("既不是正数,也不是负数!\n"); else printf 阅读全文
posted @ 2021-10-24 20:39 未步乘风 阅读(33) 评论(0) 推荐(0)
摘要: 10.12作业 1、编写程序,定义两个整型变量,赋值并输出。 #include <stdio.h> main(){ int a=3; int b=6; printf("%d%d\n",a,b); } 2、编写程序,定义一个单精度和一个双精度的变量,赋值并输出。 #include <stdio.h> 阅读全文
posted @ 2021-10-13 21:50 未步乘风 阅读(61) 评论(0) 推荐(0)
摘要: 四、编写程序 1、编写程序,输出“我爱学习C语言!”。 2、分行输出自己的专业和姓名。 3、用*号输出字母C的图案。 #include<stdio.h> main(){ printf("我爱学习C语言!\n"); printf("计算机2107\n"); printf("吴贤林\n"); print 阅读全文
posted @ 2021-09-28 22:21 未步乘风 阅读(20) 评论(0) 推荐(0)