📄 l15.1a
字号:
#printWrite a program that reads in lines one at a time,and prints them out if their length (includingthe newline) is odd.You can use the function getline if you like; the objectfile is in getline.o.Compile and run it, then type "ready".#once #create Ref1this line contains an odd number of letters!this line, however, contains an even number of letters!#once #create Ref2this line contains an odd number of letters!#once cp %s/getline.o .#usera.out <Ref1 >x1#cmp x1 Ref2#succeed/* It's certainly easiest with getline: */ #include <stdio.h>main(){ char line[500]; int n; while ((n = getline(line, 500)) > 0) if (n % 2 == 1) printf("%s", line);}#log#next15.1b 10
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -