Professional Documents
Culture Documents
h>
#include <string.h>
struct hs;
char* lines(char c, int len);
char* center(char s[],int len);
void printLine(char c);
void printTitle();
void showAll();
void saveToFile();
int main()
{
int n = 1;
struct hs {}list[100];
for(int i=0;i<n;i++){
printf("Ho va Ten: ");
gets(list[i].name);
printf("Nam sinh: ");
scanf("%d%*c",&list[i].yob);
printf("Gioi tinh: ");
scanf("%d%*c",&list[i].sex);
}
printTitle();
showAll(list,n);
return 0;
}
struct hs{
char name[100];
int yob;
int sex;
};
printLine('=');
000000000000000000
/******************************************************************************
Online C Compiler.
Code, Compile, Run and Debug C program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <stdio.h>
#include <string.h>
struct hs{
char name[100];
int yob;
int sex;
};
char* lines(char c, int len){
static char s[1000];
for(int i = 0; i < len; i++)
s[i] = c;
s[len] = '\0';
return s;
}
char* center(char s[],int len){
int llen = len - strlen(s);
llen /= 2;
static char s_new[1000] = "";
for(int i = 0; i < llen; i++)
s_new[i] = 32;
for(int i = 0; i < strlen(s); i++)
s_new[llen+i] = s[i];
for(int i = llen + strlen(s); i < len; i++)
s_new[i] = 32;
s_new[len] = '\0';
return s_new;
}
void printLine(char c){
printf("+%s", lines(c, 52));
printf("+%s+", lines(c, 10));
printf("%s+", lines(c, 12));
}
void printTitle(){
char colunms[][10] = {"Ho va Ten","Nam sinh","Gioi tinh"};
printLine('=');
return 0;
}