摘要: 1. 定义圆形半径,求面积。 package ccc; import java.util.Scanner; public class ccc { public static void main(String[] args) { // TODO Auto-generated method stub S 阅读全文
posted @ 2023-03-19 20:53 owxd 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1.编写程序,使用while语句求和sum=1+3+5+7+…+21。 #include<stdio.h> main(){ int a=1,sum=0; while(a<22){ if(a%2<=1) sum+=a; a+=2; } printf("%d\n",sum); } 2.编写程序,使用wh 阅读全文
posted @ 2021-11-22 20:48 owxd 阅读(3) 评论(0) 推荐(0) 编辑
摘要: .输出图 #include<stdio.h> main(){ int i,j,k; for(i=1;i<=5;i++) { for(k=1;k<=i;k++) printf("*"); printf("\n"); } } 输出 #include<stdio.h> main(){ int i,j,k; 阅读全文
posted @ 2021-11-22 20:48 owxd 阅读(7) 评论(0) 推荐(0) 编辑
摘要: include<stdio.h> main(){ int a; printf("输入学生分数(0-100):\n"); scanf("%d",&a); switch(a/10) { case 10: case 9:printf("A\n");break; case 8:printf("B\n");b 阅读全文
posted @ 2021-11-22 20:47 owxd 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 一、 编写程序,定义两个整型变量,赋值并输出 #include<stdio.h> main() { int a=8; int b=6; printf("%d%d\n",a,b); } 二、 编写程序,定义一个单精度和一个双精度的变量,赋值并输出 #include<stdio.h> main() { 阅读全文
posted @ 2021-10-16 11:39 owxd 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 一、 编写程序输出我爱c语言 #include<stdio.h> main() { printf(" 我爱C语言\n"); } 2.分行输出自己的姓名和专业 #include<stdio.h> main() { printf(" 计算机科学与技术\n"); printf(" 韩宗育\n"); } 3 阅读全文
posted @ 2021-10-05 20:36 owxd 阅读(7) 评论(0) 推荐(0) 编辑