摘要: 1.定义圆形半径,求面积。Int r=5; package wen; public class Test { public static void main(String[] args) { // TODO Auto-generated method stub double r=5; double  阅读全文
posted @ 2023-03-29 23:03 苏本琪 阅读(34) 评论(0) 推荐(0)
摘要: 1.输入一个三位数,求个位,十位,百位 #include<stdio.h> main() { int a=857; int ge=a%10; int shi=a/10%10; int bai=a/100; printf("个位是%d,十位是%d,百位是%d",ge,shi,bai); } .输入一个 阅读全文
posted @ 2021-12-04 21:51 苏本琪 阅读(46) 评论(0) 推荐(0)
摘要: 1.实现一个菜单 可以切换 ,可以返回主菜单 主菜单 1.登录 2.注册 3.输出水仙花数 4.退出程序 请选择: 选择后实现对应的功能 #include<stdio.h> #include<string.h> void mainMenu(); void login(); void regist() 阅读全文
posted @ 2021-12-04 21:45 苏本琪 阅读(15) 评论(0) 推荐(0)
摘要: 1.定义一个含有8个存储单位的实型数组,从键盘上接受数,然后逆序输出 #include<stdio.h> main(){ int a[8]; int i; for(i=0;i<=7;i++){ scanf("%d",&a[i]); } for(i=7;i>=0;i--){ printf("%d",a 阅读全文
posted @ 2021-11-18 21:52 苏本琪 阅读(24) 评论(0) 推荐(0)
摘要: 1.猜数字,如果大了提示大了点,小了提示小了点 #include<stdio.h> #include <stdlib.h> #include <time.h> int main() { while(1){ int a=0,b; srand((unsigned)time(NULL)); a = ran 阅读全文
posted @ 2021-11-15 23:38 苏本琪 阅读(30) 评论(0) 推荐(0)
摘要: 1.将输入的分数mark(0-100整数)转换为相应的等级(90-100为A,80-90为B,70-80为C,60-69为D,0-59为NO PASS!)。 #include<stdio.h> main(){ int mark; printf("请输入学生的分数(0-100):\n"); scanf 阅读全文
posted @ 2021-11-15 23:27 苏本琪 阅读(52) 评论(0) 推荐(0)
摘要: 1.编写程序判断n为正数还是负数 #include<stdio.h> main(){ int n; printf("请输入数字"); scanf("%d",&n); if(n<0) printf("%d是负数",n); else if(n==0) printf("%d是非正非负数",n); else 阅读全文
posted @ 2021-11-15 23:06 苏本琪 阅读(46) 评论(0) 推荐(0)
摘要: 1, 1.#include<stdio.h> main(){ int i,j; for(i=1;j<=5;i++){ for(j=1;j<=i;j++){ printf("*"); } printf("\n"); } } 2, 3.#include<stdio.h> main(){ int i,j, 阅读全文
posted @ 2021-11-09 10:35 苏本琪 阅读(54) 评论(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("%d",sum); } 2.编写程序,使用while语句求和sum 阅读全文
posted @ 2021-11-02 21:08 苏本琪 阅读(34) 评论(0) 推荐(0)
摘要: 1.编写程序,判断一个数n是正数还是负数 #include<stdio.h> main(){ int n; scanf("%d",&n); if(n>0){ printf("%d是正数\n",n);} else{printf("%d是负数\n",n);} } 2.编写程序,计算出出租车的行驶距离与费 阅读全文
posted @ 2021-10-19 16:06 苏本琪 阅读(26) 评论(0) 推荐(0)