-
-
Save takatakamanbou/64dc9521df74f799a510 to your computer and use it in GitHub Desktop.
2017年度応用プログラミング及び実習 ex06B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***** kenshin3.c *****/ | |
// 講義資料のとあちこちちょっと違う...ぼちゃぼちゃぼちゃぼちゃぼちゃ) | |
#include <stdio.h> | |
#include "kcard.h" | |
int main(void) | |
{ | |
KCard a, b, tmp; | |
int i; | |
scanf("%s %lf %lf", a.name, &a.height, &a.weight); | |
scanf("%s %lf %lf", b.name, &b.height, &b.weight); | |
tmp = a; a = b; b = tmp; | |
printf("%s さんの体重は %.1f[kg],BMIは %.2f です\n", a.name, a.weight, BMI(a)); | |
printf("%s さんの体重は %.1f[kg], BMIは %.2f です\n", b.name, b.weight, BMI(b)); | |
printf(" Pocha => "); for(i = 0; i < 5; i++ ) Pocha(b); | |
printf("%s さんの体重は %.1f[kg], BMIは %.2f です\n", b.name, b.weight, BMI(b)); | |
printf(" Pocha2 => "); for(i = 0; i < 5; i++ ) Pocha2(&b); | |
printf("%s さんの体重は %.1f[kg], BMIは %.2f です\n", b.name, b.weight, BMI(b)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment