자유게시판입니다.
#include <stdio.h>
#define BEGIN 10
#define LIMIT -5
#define STEP 5
main()
{
int Celsius;
double Fahrenheit;
printf(" Celsius Fahrenheit\n");
for(Celsius=BEGIN; Celsius >= LIMIT; Celsius -= STEP)
{
Fahrenheit = Celsius * 9 / 5 + 32;
printf("%8d %11.2lf\n", Celsius, Fahrenheit);
}
}
#include <stdio.h>
#include <math.h>
void main()
{
int count;
double num, sum2;
double sum;
double min, max, ave;
double p, pp;
printf("프로그램을 종료하려면 0을 입력하시오.\n\n");
printf("점수를 입력하시오 => ");
scanf("%lf", &num);
count=0;
sum=0;
sum2=0;
min=num;
max=num;
for(;;)
{
if(num == 0)break;
sum += num;
count++;
sum2 +=num*num;
ave=sum/count;
pp=sum2/count - ave*ave;
p=sqrt(pp);
if(min > num)
min=num;
else if (max<num)
max=num;
printf("점수를 입력하시오=> ");
scanf("%lf", &num);
}
printf("\n%10s;%5d\n\n","입력된 자료수", count);
printf("%-10s%10.5f\n", "총합", sum);
printf("%-10s%10g\n", "최소값", min);
printf("%-10s%10g\n", "최대값", max);
printf("%-10s%10g\n", "평균", ave);
printf("%-10s%10g\n", "제곱의합", sum2);
printf("%-10s%10g\n", "분산", pp);
printf("%-10s%10g\n", "표준편차", p);
}
이거하는데 무려 1시간30분이나 걸렸다는거요...ㅜㅜ한심해라...
#define BEGIN 10
#define LIMIT -5
#define STEP 5
main()
{
int Celsius;
double Fahrenheit;
printf(" Celsius Fahrenheit\n");
for(Celsius=BEGIN; Celsius >= LIMIT; Celsius -= STEP)
{
Fahrenheit = Celsius * 9 / 5 + 32;
printf("%8d %11.2lf\n", Celsius, Fahrenheit);
}
}
#include <stdio.h>
#include <math.h>
void main()
{
int count;
double num, sum2;
double sum;
double min, max, ave;
double p, pp;
printf("프로그램을 종료하려면 0을 입력하시오.\n\n");
printf("점수를 입력하시오 => ");
scanf("%lf", &num);
count=0;
sum=0;
sum2=0;
min=num;
max=num;
for(;;)
{
if(num == 0)break;
sum += num;
count++;
sum2 +=num*num;
ave=sum/count;
pp=sum2/count - ave*ave;
p=sqrt(pp);
if(min > num)
min=num;
else if (max<num)
max=num;
printf("점수를 입력하시오=> ");
scanf("%lf", &num);
}
printf("\n%10s;%5d\n\n","입력된 자료수", count);
printf("%-10s%10.5f\n", "총합", sum);
printf("%-10s%10g\n", "최소값", min);
printf("%-10s%10g\n", "최대값", max);
printf("%-10s%10g\n", "평균", ave);
printf("%-10s%10g\n", "제곱의합", sum2);
printf("%-10s%10g\n", "분산", pp);
printf("%-10s%10g\n", "표준편차", p);
}
이거하는데 무려 1시간30분이나 걸렸다는거요...ㅜㅜ한심해라...