C Language 12th time assignment

Source: Internet
Author: User

1,

#include <stdio.h>structstudent{Charnumber[Ten]; Charname[ -]; intAge ; Chargender[5]; Chartelephone[ the]; Chardepartment[ -]; intscore;}; intMain () {printf ("define struct type \ n"); return 0;}

2, the code of the problem does not know why the operation will be error, appear (Ld.exe), no matter how the changes can not be normal operation, to find other students to inquire also did not find any problems, is the software broken?

#include <stdio.h>#include<stdlib.h>structstudent{Charnumber[Ten]; Charname[ -]; intAge ;}; intMain () {student class3[ to]; FILE*fp=fopen ("E:\input.txt","R"); FSCANF (FP,"%s%s%d", class3[0].number,class3[0].name,&class3[0].age);    Fclose (FP); FP=fopen ("E:\output.txt","W"); fprintf (FP,"%s%s%d\n", class3[0].number,class3[0].name,class3[0].age);        Fclose (FP); return 0;}

3, and the teacher in class to talk about the knowledge is almost the same, no big changes.

#include <stdio.h>structstudent{Charnumber[Ten]; Charname[ -]; intAge ;}; voidAddstudent () {student class3; intch; FILE*fp=fopen ("E:\student.txt","A +"); printf ("Please enter the number of the study:"); scanf ("%s", Class3.number); printf ("Please enter your name:"); scanf ("%s", Class3.name); printf ("Please enter your age:"); scanf ("%d",&class3.age); fprintf (FP,"%s%s%d\n", Class3.number,class3.name,class3.age); printf ("Information added successfully, whether to continue to add student information (a)"); scanf ("%s",&ch);  Do{printf ("Please enter the number of the study:"); scanf ("%s", Class3.number); printf ("Please enter your name:"); scanf ("%s", Class3.name); printf ("Please enter your age:"); scanf ("%d",&class3.age); fprintf (FP,"%s%s%d\n", Class3.number,class3.name,class3.age); printf ("Information added successfully, whether to continue to add student information (a)"); scanf ("%s",&ch); } while(ch==1);}intMain () {printf ("class three student management system \ n"); printf ("1. Add student information \ n"); printf ("2.............\n"); printf ("3.............\n"); intA; scanf ("%d",&a); if(a==1) addstudent (); return 0;}

This homework feeling difficulty is not particularly big, the teacher in class time has spoken, do up still is relatively easy.

C Language 12th time assignment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.