//1
#include <stdio.h>
int main() {
int n;
printf("νλ³μ κΈΈμ΄?");
scanf_s("%d", &n);
printf("μ μ¬κ°νμ λμ΄: %d\n",n*n);
printf("μ μ¬κ°νμ λλ : %d\n",n*4);
return 0;
//2
#include <stdio.h>
int main() {
int w;
int h;
printf("κ°λ‘μ κΈΈμ΄?");
scanf_s("%d", &w);
printf("μΈλ‘μ κΈΈμ΄?");
scanf_s("%d", &h);
printf("μ§μ¬κ°νμ λμ΄: %d\n",w*h);
printf("μ§μ¬κ°νμ λλ : %d\n",(w+h)*2);
return 0;
}β
//3
#include <stdio.h>
int main() {
int m;
int h;
printf("μ§λ(kg)?");
scanf_s("%d", &m);
printf("λμ΄(m)?");
scanf_s("%d", &h);
printf("μμΉμλμ§: %f\n",9.8*m*h);
return 0;
}
//4
#include <stdio.h>
int main() {
float f;
float s;
printf("ν(N)?");
scanf_s("%f",&f);
printf("μ΄λ거리(m)?");
scanf_s("%f",&s);
printf("μΌμ μ: %.2f J", (f * s));
return 0;
}
//5
#include <stdio.h>
int main() {
float c;
printf("κΈΈμ΄?");
scanf_s("%f",&c);
printf("%f inch = %f cm",c, c*2.54);
return 0;
}
//6
#include <stdio.h>
int main() {
float c;
printf("μννΈμ λ©΄μ (μ κ³±λ―Έν°)?");
scanf_s("%f",&c);
printf("%.2f μ κ³±λ―Έν° = %.2f ν",c, (c*0.3025));
return 0;
}
//7
#include <stdio.h>
int main() {
float a;
printf("μ€μ?");
scanf_s("%f",&a); //or %e
printf("μ κ³± %e\n",a*a);
printf("μΈμ κ³± %e:",a*a*a);
return 0;
}
//8
#include <stdio.h>
int main() {
int a;
printf("κΈΈμ΄(yb)?");
scanf_s("%d",&a);
printf("%d μΌλ = %fm",a,(a*0.9144));
return 0;
}
//9
#include <stdio.h>
int main() {
int a;
printf("무κ²(ld)?");
scanf_s("%d",&a);
printf("%d ld = %f kg",a,(a*0.45359237));
return 0;
}
//10
#include <stdio.h>
int main() {
float a,b;
printf("USD?");
scanf_s("%f",&a);
printf("μ.λ¬λ¬ νμ¨?");
scanf_s("%f", &b);
printf("USD %.2f = KRW %.2f",a,(a*b));
return 0;
}
//11
#include <stdio.h>
int main() {
float a,b;
printf("KRW?");
scanf_s("%f",&a);
printf("μ.λ¬λ¬ νμ¨?");
scanf_s("%f", &b);
printf("KRW %.0f = USD %.2f",a,(a/b));
return 0;
}