zoukankan      html  css  js  c++  java
  • 12ci zuoye

    #include<stdio.h>
    struct student
    {
        char number[10];
        char name[20];
        int age;
    }; 
    void one()
    {
        student class3;
        char b;
        FILE *fp=fopen("c:\student.txt","a+");
        printf("?????:");
        scanf("%s",class3.number);
        printf("?????:");
        scanf("%s",class3.name);
        printf("?????:");
        scanf("%d",&class3.age);
        fprintf(fp,"%s    %s    %d
    ",class3.number,class3.name,class3.age);
        printf("????,??????????(yes/no):");
        scanf("%s",&b);
        do
        {
            printf("?????:");
            scanf("%s",class3.number);
            printf("?????:");
            scanf("%s",class3.name);
            printf("?????:");
            scanf("%d",&class3.age);
            fprintf(fp,"%s    %s    %d
    ",class3.number,class3.name,class3.age);
            printf("????,??????????(yes/no):");
            scanf("%s",&b);
        }while(b=='yes');
    }
    int main()
    {
        printf("----------??????----------
    ");
        printf("1.??????
    "); 
        printf("2.??????
    ");
        printf("3.??????
    ");
        printf("4.??????
    ");
        printf("???:
    ");
        int a;
        scanf("%d",&a);
        if(a==1)
            one();     
        return 0;
    }
    #include<stdio.h>
    #include<stdlib.h>
    struct student{
        char sno[10];
        char stele[15];    
    };
    int main()
    {    
        student class3[31];
        scanf("%s%s%s%d%d",&class3[0].sno,&class3[0].sname,&class3[0].stele,&class3[0].age,&class3[0].score);
        printf("%s %s %s %d %d",class3[0].sno,class3[0].sname,class3[0].stele,class3[0].age,class3[0].score);
        return 0;    
    }
    #include<stdio.h>
    struct student
    {
        char sno[10];
        char sname[20];
        int age;
        char tel[11];
        int score;
    }; 
    
    int main()
    {
        student class3[31];
        int i;
        for(i=0;i<31;i++)
              scanf("%s%s%d%s%d",class3[i].sno,class3[i].sname,&class3[i].age,class3[i].tel,&class3[i].score);
        for(i=0;i<31;i++)
              printf("%s %s %d %s %d
    ",class3[i].sno,class3[i].sname,class3[i].age,class3[i].tel,class3[i].score);
        return 0;
    }
  • 相关阅读:
    《数字图像处理原理与实践(MATLAB版)》一书之代码Part5
    编程算法
    SVM 输出分类概率(python)
    mysql 数据库通过拷贝文件恢复方法
    ubuntu取消自动登录
    迁移mysql数据位置
    No module named 'lsb_release'
    python3 ssl导入失败
    Linux tar: Cannot change ownership to [..]: Permission denied
    树莓派蓝牙
  • 原文地址:https://www.cnblogs.com/zyz9641/p/6185356.html
Copyright © 2011-2022 走看看