Simple implementation of Student information processing program

Source: Internet
Author: User

Source: POJ (Coursera statement: The exercises completed on POJ will not count against the final results of Coursera. )

Note: Total time limit: 1000ms memory limit: 65536kB

Describe

In a Student information processing program, it is required to implement a class that represents a student, and all member variables should be private.

(Note: The evaluation system cannot automatically determine whether a variable is private.) We will be at the end of the unification of the operation of the inspection, please students in strict accordance with the requirements of the completion, otherwise it may affect the performance of the work. )

Input

Name, age, school number, average grade for the first school year, average performance for the second school year, average grade for the third school, average results for the fourth school year.

The name, the school number is a string, does not contain spaces and commas, the age is a positive integer, the result is a nonnegative integer.

Each part of the content is separated by a single English comma ",", no extra space.

Output

One row, output sequentially: Name, age, school number, four-year average score (rounded down).

Each part of the content is separated by a single English comma ",", no extra space.

Sample input
Tom,18,7817,80,80,90,70
Sample output
tom,18,7817,80

1#include <iostream>2#include <cstring>//the following two header files do not write the compiler will not error, operation is normal. 3#include <cstdio>//but when they get to the OJ, they get less: "Complete error."4 using namespacestd;5 classStudent {6 Private:7     Charname[ -], stdnum[ -];8     intAge , A, B, C, D, score;9  Public:Ten     voidinput () { OneCin.getline (Name, -,','); Ascanf"%d,", &Age ); -Cin.getline (Stdnum, -,','); -scanf"%d,%d,%d,%d", &a, &b, &c, &d);//use SACNF to enter commas the     } -     voidoutput () { -cout << name <<","<< Age <<","<< Stdnum <<","<<score; -     } +     voidaverage () { -Score = (A + B + C + D)/4; +     } A }; at  - intMain () - { - student Student1; - student1.input (); - student1.average (); in student1.output (); -     return 0; to}

Simple implementation of Student information processing program

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.