
这个程序为啥编译不了呢,请彦祖们看看,指点哈,没法咯,要水字数了,
第5行sacnf写错了,应为scanf。
修改如下:
参考链接:
C 库函数 – scanf() | 菜鸟教程
C 库函数 - scanf() C 标准库 - <stdio.h> 描述 C 库函数 int scanf(const char *format, ...) 从标准输入 stdin 读取格式化输入。 声明 下面是 scanf() 函数的声明。 int scanf(const char *format, ...) 参数 format -- 这是 C 字符串,包含了以下各项中的一个或多个:空格字符、非空..
https://www.runoob.com/cprogramming/c-function-scanf.html
C语言-switch用法 - 知乎
switch语句,适用于条件是整型变量或字符变量的等值判断。比如根据输入的值,决定执行的语句。格式: switch(表达式) { case 常量表达式1: 语句组1;[break]; case 常量表达式2: 语句组2;[break]; ┇ case 常…
https://zhuanlan.zhihu.com/p/304077703
#include <stdio.h>
int main(void){
int a;
// https://www.runoob.com/cprogramming/c-function-scanf.html
// 获取一个整数的函数sacnf拼写错误,应为scanf
scanf("%d",&a);
// https://zhuanlan.zhihu.com/p/304077703
switch(a){
case 1:printf("星期一");break;
case 2:printf("星期二");break;
case 3:printf("星期三");break;
case 4:printf("星期四");break;
case 5:printf("星期五");break;
case 6:printf("星期六");break;
case 7:printf("星期七");break; // 这里的"星期七"是否要改为 "星期日"?
}
return 0;
}
