实验五
#include <stdio.h>
int add(int a,int b)
{int c; c=a+b; return c;}
int minus(int a, int b)
{int c; c=a-b;return c;}
int multip(int a,int b)
{int c; c=a*b; return c;}
int quotient(int a, int b)
{int c; c=a/b;return c;}
int mod(int a,int b)
{int c; c=a%b;return c;}
int main()
{
int x,y;
scanf("%d%d",&x,&y);
printf("%d\n%d\n%d\n%d\n%d\n",add(x,y),minus(x,y),multip(x,y),quotient(x,y),mod(x,y));
return 0;
}
#include <stdio.h>
int p(int a)
{
int i,j,k;
if(a==0||a==1) k=0;
else if(a==2) k=1;
else for(i=a-1;i>1;i--)
{ if(a%i==0){k=0;break;}
else k=1;
}
return k;
}
int main()
{
int n;
scanf("%d",&n);
if(p(n)==1) printf("YES\n");
else printf("NO\n");
return 0;
}
#include <stdio.h>
int max2(int a,int b)
{ if(a>b) return a;
else return b;}
int max4(int a,int b,int c,int d)
{if(max2(a,b)>max2(c,d)) return max2(a,b);
else return max2(c,d);}
int main()
{int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
printf("%d\n",max4(a,b,c,d));
return 0;
}