Warm up:C input and output
来源:互联网 发布:2016非农数据 编辑:程序博客网 时间:2024/06/05 10:10
谨以此练习来学习最基础的C语言输入和输出。
Description
This is an exercise for you to get prepared for C language programming.
All you have to do is to accept a string as input, and print it character by character. Characters are separated by new line.
The difficulty lies in deciding wether the string ends or not, and 'EOF' is used to solve the problem(see hint).
Input
A string.
Output
Print those characters of the given string, one character per line.
Sample Input
Hi!
Sample Output
Hi!
HINT
Kernel code:
char ch;
while(scanf("%c",&ch) != EOF) {
// DO SOMETHING
}
#include <stdio.h> //头文件,标准输入输出#include <stdlib.h>int main(){ int ch; while(scanf("%s",&ch)!=EOF){ printf("%s\n",ch);};return(0);
阅读全文
0 0
- Warm up:C input and output
- [Introduction and Warm-up]
- Introduction and warm up homework
- input and output
- itk input and output
- Python input and output
- Input and Output
- 7. Input and Output
- 8 Input and Output
- The C programing language chapter 7 : Input and Output
- Input and output of iostream.
- Ch.7 - Input and Output
- Hadoop Streaming Input and Output
- Redirecting standard input and output
- File Input and Output(1)
- Standard Input and Output Redirection
- I/O Input and Output
- [Language]File Input and Output
- SpringBoot学习-(十九)SpringBoot定时器#Schedule
- ThoughtWorks 2018校园招聘作业题目 -- 出租车
- 去除ios移动端alert/confirm的网址(url)
- C++ primer第五版“Sale_item.h”头文件
- Zookeeper数据与存储
- Warm up:C input and output
- TOMCAT异常退出分析和解决方法
- Linux操作系统第二章问答
- 异步TCP通信-select
- 删除功能测试的测试点
- Glide工具类
- c#的DateTime.Now函数详解
- HDU
- 2017-10-16校内训练题题解