Skip to content

Instantly share code, notes, and snippets.

@takatakamanbou takatakamanbou/kenshin3.c Secret
Last active Oct 14, 2017

Embed
What would you like to do?
2017年度応用プログラミング及び実習 ex06B
/***** 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
You can’t perform that action at this time.