Ⅰ C語言,順序結構
1.#include<stdio.h>
void main()
{char c1,c2;
c1=getchar();
c2=getchar();
putchar(c1);
printf("%c",c2);}
2.#include<stdio.h>
void main()
{int r,h;
float s,v;
printf("請輸入圓的半徑:\n");
scanf("%d",&r);
printf("請輸入圓的高:\n");
scanf("%d",&h);
printf("圓的面積是:\n");
s=3.14*r*r;
printf("%3.2f\n",s);
printf("圓柱的體積:\n");
v=s*h;
printf("%3.2f\n",v);}
}