a와 b 지점에서 둘이 출발하여 서로 마주칠때 값은?
페이지 정보
본문
#include <stdio.h>
#include <conio.h>
int main()
{
float a , b, c , d;
printf("A의 속도는 : ");
scanf("%f",&a);
fflush(stdin);
printf("B의 속도는 : ");
scanf("%f",&b);
puts("");
puts(" 가 ------------------------ 나 ");
puts(" +--------거리 120m ----+ ");
puts("");
printf("A는'가'에서 시속%.2f로 '나'로 가고 B는 '나'에서 시속%.2f로 '가'향하고 있다\n",a,b);
printf(" A와 B 는 얼마뒤에 만나겠는가?\n");
printf(" %.2f + %.2f = %.2f , %d / %.2f = %.2f ",a,b,a+b,120,a+b,120/(a+b));
getch();
return 0;
}
#include <conio.h>
int main()
{
float a , b, c , d;
printf("A의 속도는 : ");
scanf("%f",&a);
fflush(stdin);
printf("B의 속도는 : ");
scanf("%f",&b);
puts("");
puts(" 가 ------------------------ 나 ");
puts(" +--------거리 120m ----+ ");
puts("");
printf("A는'가'에서 시속%.2f로 '나'로 가고 B는 '나'에서 시속%.2f로 '가'향하고 있다\n",a,b);
printf(" A와 B 는 얼마뒤에 만나겠는가?\n");
printf(" %.2f + %.2f = %.2f , %d / %.2f = %.2f ",a,b,a+b,120,a+b,120/(a+b));
getch();
return 0;
}
댓글목록
등록된 댓글이 없습니다.