- 日時: 2024/05/14 18:17
- 名前: 大魔王 (ID: kpDooGZ2)
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h>
// 構造体 typedef struct { char name[64]; int hp; int mp; int pow; int def; } status;
int main(void) {
status nakama[3] = { {"KEN", 250, 140, 100, 60}, {"KEN", 250, 140, 100, 60}, {"KEN", 250, 140, 100, 60}, };
for (int i = 0; i < 3; i++) { printf("NAME:%s HP:%d MP:%d ATK:%d DEF:%d\n", nakama[i].name, nakama[i].hp, nakama[i].mp, nakama[i].pow, nakama[i].def); } return 0; }
|