1.变量
2.运算符
3.if判断
4.接力break
5.最大公约数
6.水仙花数
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
//根据输入的位数计算,如最小三位数100
int first = 1;
int i =1;
while(i<n){
first *=10;
i++;
}
printf("first=%d\n",first);
i = first;
//计算求个位数幂次和
while(i < first*10){
int t = i;
int sum =0;
do{
int d = t%10;
t/=10;
//计算幂次
int p = d;
int j = 1;
while(j<n){
p *= d;
j++;
}
//计算各位幂次之和
sum += p;
}while(t>0);
if(sum == i){
printf("%d\n",i);
}
i++;
}
return 0;
}
7.统计素数并求和
8.猜数字
#include<stdio.h>
int main(){
int number,n;
int count = 0;
int finished = 0;
int inp;
scanf("%d %d",&number,&n);
do{
scanf("%d",&inp);
count++;
if(inp<0){
printf("Game Over!\n");
finished = 1;
}else if(inp > number){
printf("Too Big!\n");
}else if(inp < number){
printf("Too Small!\n");
}else{
if(count == 1){
printf("Bingo!\n");
}else if(count <= 3){
printf("Lucky You!\n");
}else{
printf("Good Guess!\n");
}
finished = 1;
}
if(count == n){
if(!finished){
printf("Game Over!\n");
finished = 1;
}
}
}while(!finished);
return 0;
}
9.数据类型
int反应计算机字长
10.计算基本内部数据表示
11.浮点数
12.字符类型

13.类型转换
14.逻辑运算

15.条件运算符
16.函数
17.变量作用域
18.数组
19. 指针


20.字符串
















21.结构体
结构的名字并不是地址


22.全局变量
23.声明
24.格式化输入输出

25.文件

26.二进制文件