#include<stdio.h>
int main()
{
float F,c
while(1)
{
printf("请输入华氏温度:")
scanf("%f",&F)
c=5*(F-32)/9
printf("摄氏温度为:%0.2f",c)
return 0
}
}
1.#include
<stdio.h>
int
main()
{
int
y0,
m0,
d0,
y1,
m1,
d1,
age
while
(
scanf("%d%d%d%d%d%d",
&y0,
&m0,
&d0,
&y1,
&m1,
&d1
)
){
age
=
y1
-
y0
-
1
if
(
m1
>
m0
||
m1
==
m0
&&
d1
>=
d0
)
++age
printf("年龄为:%d周岁!\n",
age)
}
return
0
}
4.
#include
<stdio.h>
#include
<memory.h>
int
main()
{
char
p[500]
int
i,
count
while
(
scanf("%s",
&p)
){
count
=
0
for
(
i
=
0
i
!=
strlen(p)
++i
)
if
(
p[i]
>=
'a'
&&
p[i]
<=
'z'
)
++count
printf("%d\n",
count)
}
return
0
}
2.
#include
<stdio.h>
int
main()
{
int
n
while
(
scanf("%d",
&n)
){
if
(
(
n
&
1
)
==
0
)
printf("%d是偶数!\n",
n)
else
printf("%d,是奇数!\n",
n)
}
return
0
}
第三题(用EFO结束)?EOF吧?EOF已经是文件尾,怎样输出结果?
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)