Skip to content

Instantly share code, notes, and snippets.

@takatakamanbou
Last active October 14, 2017 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takatakamanbou/64dc9521df74f799a510 to your computer and use it in GitHub Desktop.
Save takatakamanbou/64dc9521df74f799a510 to your computer and use it in GitHub Desktop.
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