1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char caption[50];
char name[30];
int hp;
int lvl;
char choice[1];
FILE fp;
int main(int argc, char *argv[]){
system("clear");
printf("Enter Enemy name: ");
fgets(name, 50, stdin);
printf("\nEnter Enemy Caption: ");
fgets(caption, 30, stdin);
printf("\nEnter Enemy HP: ");
scanf("%i", &hp);
printf("\nEnter Enemy LVL: ");
scanf("%i", &lvl);
printf("\nname: %s", name);
printf("caption: %s", caption);
printf("HP: %i\n", hp);
printf("LVL: %i\n", lvl);
fp = fopen("btl.TTXT", "w");
fprintf(fp, "%c", name);
fprintf(fp, "%c", caption);
fprintf(fp, "%i", hp);
fprintf(fp, "%i", lvl);
fclose(fp);
return 0;
}
|