mirror of
https://github.com/nolongeractivemp3/shipthatcode-c.git
synced 2026-11-24 10:45:12 +01:00
lesson 3
This commit is contained in:
1 parent
904310819d
commit
5ccb168902
1 file changed
+10
-7
@@ -1,11 +1,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
double test = 0.0;
|
int w, h;
|
||||||
double test2 = 0.0;
|
scanf("%d", &w);
|
||||||
scanf("%lf\n%lf", &test, &test2);
|
scanf("%d", &h);
|
||||||
double sum = test+test2;
|
long long area = w * h;
|
||||||
int intsum = (int)sum;
|
double ratio = (double)w/h;
|
||||||
printf("%f\n%d", sum,intsum);
|
printf("%lld \n %.2f", area, ratio);
|
||||||
return 0;
|
// TODO: compute the area and the width-to-height ratio,
|
||||||
|
// then print them on two lines as the exercise describes.
|
||||||
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user