- 博客(9)
- 收藏
- 关注
原创 函数、函数调用、函数递归
1.文章前的小游戏——设计关机程序;游戏简介: 只要程序启动了, 就倒计时60秒内关机,如果60秒内,你输入:我是猪,就取消关机,如果不输入,时间到就关机。#include<stdio.h>#include<stdlib.h> //库函数system的头文件;#include<string.h>//库函数strcmp的头文件;int main(){ char input[20] = { 0 }; system...
2021-11-10 14:54:56
615
原创 分支、循环语句经典例题
一、写代码将三个整数数按从大到小输出方法1.#include<stdio.h> int main(){ int a = 0; int b = 0; int c = 0; scanf("%d %d %d", &a, &b, &c); if (a > b && b > c) printf("%d %d %d", a, b, c); else if (a > c && c > b) ..
2021-10-30 15:46:27
473
2
原创 对输入、输出及相关字符的正确理解
getchar putchar一:知识#include<stdio.h>int main(){ int ch = 0; while ((ch = getchar()) != EOF) putchar(ch); return 0;}EOF当 ch = getchar() 读取错位时ch = getchar()里面输入的显示为EOF。相当于整形中-1,并且占位四字节。上述带面表示whlie中表示条件,输入的字符的结果不能报错的意思。代码...
2021-10-28 14:14:42
337
原创 初识C语言
1.数据类型#include<stdio.h>int main(){ printf("%d\n", sizeof(int)); printf("%d\n", sizeof(short)); printf("%d\n", sizeof(char)); printf("%d\n", sizeof(long)); printf("%d\n", sizeof(long long)); printf("%d\n", sizeof(float)); p...
2021-10-25 17:59:20
326
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人