谁能帮我解答这3题 谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/05 20:45:11
1.要求输入整数a和b,若a*a+b*b大于100,则输出百位以上的数字。

2. 编写一个C程序,输入a、b、c 3个值,
输出其中最大者。

3.将100到200之间能同时被5和7整除的整数打印
出来。(5分)

1:#include "stdio.h"
#include "conio.h"
main()
{
int a,b,c;
printf("Input a and b:");
scanf("%d%d",&a,&b);
c=a*a+b*b;
if(c>100)
printf("%d",c/100);
getch();

}
2:#include "stdio.h"
#include "conio.h"
main()
{
int a,b,c,max;
printf("Input a b c:");
scanf("%d%d%d",&a,&b,&c);
max=a;
if(max<b)
max=b;
if(max<c)
max=c;
printf("%d",max);
getch();

}
3:#include "stdio.h"
#include "conio.h"
main()
{
int i;
for(i=101;i<200;i++)
if(i%7==0&&i%5==0)
printf("%d\t",i);
getch();

}
如果你的第三题由包括100和200的话,你自己应该知道怎么改下吧!还有我是用WINTC环境下编写