diff --git a/2207/C语言精通120题.md b/2207/C语言精通120题.md index e24db10..a490559 100644 --- a/2207/C语言精通120题.md +++ b/2207/C语言精通120题.md @@ -108,7 +108,21 @@ int main(){ 7.编写程序,用getchar函数读入两个字符c1,c2,然后分别用putchar函数和prinf函数输出这两个字符以 及它们的ASCII值。 +```c +#include +int main(void){ + char c1, c2; + c1=getchar(); + c2=getchar(); + putchar(c1); + printf(" %d\n", c1); + putchar(c2); + printf(" %d\n", c2); + + return 0; +} +``` 8.设圆半径r=1.5,圆柱高h=3,求圆周长,圆面积,圆球表面积,圆球体积,圆柱体积