学期1C语言实验
嫣青丶
热爱学习的小码农~~
展开
-
2.1三位数倒叙输出
/* 2.c Created on: 2018年10月23日 Author: yangchenglong */ #include<stdio.h> int main(void) { int xxx,a,b,c; //a,百位,b,十位,c,个位 printf(“Enter a three-digit number:”); setvbuf(stdou...原创 2018-12-28 16:37:13 · 183 阅读 · 0 评论 -
4.4输出100到300素数和问题
/* 44.c Created on: 2018年10月26日 Author: yangchenglong */ #include<stdio.h> #include<stdbool.h> int main(void) { bool flag; int i, j, sum = 0; for (i = 100; i <= 300; i++) { flag ...原创 2018-12-28 16:51:53 · 2318 阅读 · 0 评论 -
4.3分式阶乘问题
/* 4.3.c Created on: 2018年10月24日 Author: yangchenglong */ #include<stdio.h> int main(void) { int t,n; int i,j; //循环变量 float sum, sum_one; printf(“Enter a number...原创 2018-12-28 16:50:23 · 405 阅读 · 0 评论 -
4.2佣人佣金比较(多次输入)
/* 4.2.c Created on: 2018年10月25日 Author: yangchenglong / #include<stdio.h> int main(void) { int number; float commission_one,commission_two,share,value; do { printf(“Enter number of share...原创 2018-12-28 16:48:43 · 331 阅读 · 0 评论 -
4.1求最简分式问题
mjk,/* 4.1.c Created on: 2018年10月23日 Author: yangchenglong */ #include<stdio.h> int main(void) { int a,b,m,n,i; printf(“Enter a fraction:”); setvbuf(stdout,NULL,_IONBF,0); scanf("%d/%d",&...原创 2018-12-28 16:47:23 · 225 阅读 · 0 评论 -
3.33日期比较问题(升级)
/* 3.33.c Created on: 2018年10月26日 Author: yangchenglong */ #include<stdbool.h> #include<stdio.h> int main(void) { int mm1,dd1,yy1,mm2,dd2,yy2; bool earlier; printf(“Enter first date...原创 2018-12-28 16:45:23 · 96 阅读 · 0 评论 -
3.3比较日期靠前问题
/* 3.3.c Created on: 2018年10月25日 Author: yangchenglong */ #include<stdio.h> int main(void) { int mm1,dd1,yy1,mm2,dd2,yy2; printf(“Enter first date(mm/dd/yy):”); setvbuf(stdout,NULL,_IONBF...原创 2018-12-28 16:44:19 · 133 阅读 · 0 评论 -
3.2商品单价成本利润问题
/* 3.2.c Created on: 2018年10月24日 Author: yangchenglong / #include<stdio.h> int main(void) { int number; float commission_one,commission_two,share,value; printf(“Enter number of shares:”);...原创 2018-12-28 16:43:10 · 199 阅读 · 0 评论 -
3.1成绩分级
/* 3.c Created on: 2018年10月23日 Author: yangchenglong */ #include<stdio.h> int main(void) { int score; printf(“请输入您的百分数成绩: \n”); scanf("%d",&score); switch((int)(score/10)) { case 10: ...原创 2018-12-28 16:40:26 · 348 阅读 · 0 评论 -
2.2转换形式输出
/* 2.1.c Created on: 2018年10月23日 Author: yangchenglong */ #include<stdio.h> int main(void) { int aaa,bbb,cccc; printf(“Enter the phone number[(xxx)xxx-xxxx]:”); setvbuf(stdout,NULL,_IONBF...原创 2018-12-28 16:39:16 · 96 阅读 · 0 评论 -
5.1统计一个整数中重复出现的数以及次数
/* 5(1).c Created on: 2018年10月31日 Author: yangchenglong */ #include&amp;amp;lt;stdio.h&amp;amp;gt; #include&amp;amp;lt;stdbool.h&amp;amp;gt; int main(void) { bool flag; int dight_seen[10] = {0}; int d原创 2018-12-30 09:25:20 · 567 阅读 · 0 评论