#include <stdio.h>
int main()
{
int a,b,i,yak,qo;
FILE *in, *out;
in = fopen("input.txt", "r");
out = fopen("output.txt", "w");
fscanf(in,"%d %d", &a,&b);
for(i=1 ; i<=a ; i++) {
if(a%i==0) {
if(b%i==0) {
if(i>yak) {
yak=i;
}
}
}
}
qo=b/yak*a;
fprintf(out,"%d \n%d", yak,qo);
fclose(in);
fclose(out);
return 0;
}
¹Ù»Ú½Å ¿ÍÁß¿¡ ¹ø°Å·Ó°Ô Çؼ Á˼ÛÇÕ´Ï´Ù.
ÀÌ°ÍÀÌ ¿Ö 20Á¡ÀÎÁö ¾Ë¾ÆÁÖ½Ç ¼ö ÀÖ³ª¿ä?
#include <stdio.h>
int main()
{
int a,b,c,d,e;
FILE *in, *out;
in=fopen("input.txt", "r");
out=fopen("output.txt", "w");
fscanf(in,"%d %d %d",&a,&b,&c);
fscanf(in,"%d",&d);
e=c+d;
a=(e/60+b)/60+a;
b=(e/60+b)%60;
c=e%60;
if(a>=24) {
a=a-24;
}
fprintf(out,"%d %d %d\n",a,b,c);
fclose(in);
fclose(out);
return 0;
}
ÀÌ°ÍÀº ¿Ö 75Á¡Àΰ¡¿ä?