目录
一、编写一个程序把一个单词读入到字符数组中,然后倒叙打印这个单词。
一、编写一个程序把一个单词读入到字符数组中,然后倒叙打印这个单词。
#include<stdio.h>
int main()
{
char word[20];
int i, j;
scanf("%s",&word);
j=strlen(word);
for(i=j-1;i>=0;i--)
{
printf("%c",word[i]);
}
return 0;
}
二、编写一个程序计算圆的面积。
#include<stido.h>
#include<math.h>
int main()
{
float r,s,pi=acos(-1.0);
printf("圆的半径\nr=");
scanf("%f",&r);
s = pi*r*r;
printf("圆的面积\ns=%f",s);
return 0;
}