📄 l5.1c
字号:
#print(Section 1.5)Write a program which reads one character fromits input; if that character is ? it prints "yes",otherwise it prints "no".Compile it, test it, and then type ready.#once #create Ref1? is here#once #create Ref2no ? at beginning#usera.out <Ref1 >test1a.out <Ref2 >test2grep yes test1 >/dev/null || grep no test2 >/dev/null#succeedThis is one possible solutionmain(){ if (getchar() == '?') printf("yes\n"); else printf("no\n");}The indenting and general formatting of C programsshould be done so you make the structure clear,like the code above.#log#next5.1d 10
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -