c - 我们可以在 C 中的不同连续行中采用不同的数据类型输入吗
问题描述
int main()
int c,s;
char h;
printf("Enter the carbon\n");
scanf("%d",&c);
printf("Enter the hard\n");
scanf("%c",&h);
printf("Enter strength\n");
scanf("%d",&s);
printf("%d%d",c,s);
printf("%c",h);
}
输出:
Enter the carbon
4
Enter the hard
Enter strength
我的程序没有读取字符数据类型。谁能告诉我原因?编译器没有显示任何错误。
解决方案
推荐阅读
- python - python 3.9 discord.py asyncio.async 错误
- git - CI/CD 失败,因为缺少构建所需的文件,但在 .gitignore 中的公共存储库中不需要
- jenkins - Chromium Renderer 进程刚刚在 Jenkins 上崩溃
- airflow-scheduler - ONE_SUCCESS 触发规则上的 Aiflow 跳过任务
- mysql - 给定 3 列(sid、date、tid)和主键(date、tid)。找到每个 tid 的 sid
- javascript - 画布清除父元素属性更改
- javascript - 使用 GET (PHP:Curl, Javascript) 使用表单查询 API
- python-3.x - 使用 python 与 AzureDevops 交互
- kotlin - 私有委托方法
- python - 如何使用python中的类函数制作一个临时对象?