自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 if-else语句的成绩转换

#include<stdio.h>Void main(){ float x; printf("输入一个百分制成绩\n"); scanf("%f",&x); if(x<=100&&x>=90) printf("grade: A\n"); else if(x>=80) printf("grade: B\n"); else if(x>=7

2018-01-03 10:15:35 843

原创 switch语句的成绩转换

#include<stdio.h>#include<stdlib.h>int main(){ int score,mark; while(scanf("%D",&score)!=-1) { if(score>100&&score<0) { printf("Score is error!\n");

2018-01-03 10:10:42 1733

原创 鸡兔同笼

#include<stdio.h>#include<stdlib.h>int main(){ int S,N,x,y; printf("Input S,N"); scanf("%d %d",&S,&N); for(x=1;x<S;x++) { for(y=1;y<S;y++) { if(x+y==S&&2*

2018-01-03 10:06:23 262

原创 百钱买百鸡

#include<stdio.h>int main(){ int x,y,z; for(x=1;x<=20;x++) { for(y=1;y<=33;y++) { for(z=3;z<=99;z++) { if(x+y+z==100&&5*x+3*y+z/3.0==10

2018-01-03 09:58:14 159

原创 5.1 从键盘任意输入一个实数,不使用计算绝对值函数编程计算并输出该实数的绝对值

#include<stdio.h> int main() { int a; printf("input a:"); scanf("%d",&a); if(a>0) { a*=1; } else { a*=(-1); } printf("%d\n",

2017-12-15 11:44:19 7710

原创 计算1!+2!+3!+、、、+n!的值

#include <iostream>#include <stdio.h>#include <stdlib.h>int main(){ int i,n,sum,term; sum=0; term=1; printf("Input n:"); scanf("%d",&n); for(i=1;i<=n;i++) { term*

2017-12-13 11:52:39 699

原创 6.4 求所有数的平方和立方

#include<stdio.h>#include<stdlib.h>int main(){ int n, term1=1, term2=1, i; printf("Input n:"); scanf("%d",&n); for(i=1;i<n;i++) { term1=i*i; printf("%d\n

2017-12-13 11:23:59 223

原创 求两个数的最大公约数

main(){ int a,b,r; scanf("%d%d",&a,&b); while(b!=0) { r=a%b; a=b; b=r; } printf("%d\n",a);} 知识点: 1. 心得体会:

2017-12-13 11:07:09 137

原创 5.4年利率

#include <stdio.h>int main(){ int n,i; float capital,rate,deposit; printf("Input capital,n",capital,n); scanf("%f%d",&capital,&n); if(n>0) { switch (n) { cas

2017-12-12 10:49:57 393

原创 分数段

#include <stdio.h>#include <stdlib.h>int main(){ int i; while(1) { scanf("%d",&i); if(i>100||i<0) { printf("错误! !"); } if(i>=90) printf("A"); else if(i>=8

2017-12-12 09:37:58 198

原创 习题6.2 (3)计算a+aa+aaa+...+aa...a(n个a)的值,n和a的值由键盘输入

#include<stdio.h>int main(){ long term,sum=0; int a,i,n; printf("Input a,n:"); scanf("%d,%d",&a,&n); for(i=1;i<=n;i++) { term =pow(a*i); sum=sum+term; }

2017-11-13 19:21:38 10350 3

原创 计算并输出一个三位整数的个位、十位和百位数字之和

#include<stdio.h>int main(){ int x=153,b0,b1,b2,sum; b2=x/100; b1=(x-b2*100)/10; b0=x % 10; sum=b2+b1+b0; printf("b2=%d,b1=%d,b0=%d,sum=%d\n",b2,b1,b0,sum);return 0;} 知识点:

2017-11-13 19:03:09 7656 1

原创 大小写字母的转化及其ASCII码值

#include<stdio.h>int main(){ char ch; printf("Press a key and then press Enter:"); ch = getchar(); ch = ch+32; printf("%c,%d\n",ch,ch); /*分别输出变量ch中的字符及其ASCII码值*/return 0;

2017-11-13 13:03:39 11023

原创 九九乘法表的输入

#include<stdio.h>int main(){ int i,j; for(i=1;i<10;i++) { for(j=1;j<=i;j++) { printf("%d*%d=%d\t",j,i,i*j); } printf("\n"); }} 知识点: 1. 心得体会

2017-11-13 11:19:27 466

原创 计算1+3+5+7+...+99+101的值

这里写代码#include<stdio.h>int main(){ int i,sum=0; for(i=1;i<=101;i+=2) { sum=sum+i; } printf("sum=%d\n",sum);return 0;} 知识点: 1. 心得体会: 1.

2017-11-12 20:41:59 6467

原创 分析并写出运行结果

#include <stdio.h>int main(){ int k=4,n; for (n=0;n<k;n++); { if(n%2==0) k--; } printf ("k=%d,n=%d\n",k,n); return 0;}知识点: 1.不在循环中继续语句; 2.区分了=和==的作用 心得体会:

2017-11-12 19:20:43 335

原创 我的第一个程序

#include<stdio.h>int main(){ printf("Hello world!" ); return 0;}知识点:1.学会了编程; 2.学会了使用编程软件。 心得体会;1.c语言是一门很有趣的学科; 2.努力才能学得更好。

2017-11-10 20:54:55 113

原创 分析并写出下列程序的运行结果

#include<stdio.h>int main(){ int i,j,k; char space =' '; for (i=1;i<=4;i++) { for(j=1;j<=i;j++) { printf("%c",space); } for(k=1;k<=6;k++)

2017-11-10 20:36:06 1933

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除