Problem.11718
Problem.11718
그대로 출력하기1
문제 : 입력 받은 대로 출력하는 프로그램을 작성하시오.
#include <stdio.h>
int main(int argc,char **argv){
char through_out;
while((through_out=getchar())!=EOF){
putchar(through_out);
}
}
풀이 : 여러가지 함수가 있지만 개행(\n)문자가 들어와도 입력이 끝나면 안된다.
때문에 getchar함수를 통해 개행(\n)문자 까지 출력하면 입력 그대로 출력 완료
comments powered by Disqus