写一个c 程序 Write a C programWrite a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in th

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 13:24:04
写一个c 程序 Write a C programWrite a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in th

写一个c 程序 Write a C programWrite a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in th
写一个c 程序 Write a C program
Write a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in the final examination (maximum 100,however,the user may introduce a lower number of entries).The input format must be the following:
 NAME LASTNAME student_ID MARK
In the case the reference ID is introduced in the provided list,the program must compute how many students obtained lower and higher marks compared to the reference one.

写一个c 程序 Write a C programWrite a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in th
#include<iostream>
#define MAXSIZE 100
using namespace std;
struct Student
{
char name[20];
char last_name[20];
int ID;
int mark;
};
class list
{
private:
Student stu[MAXSIZE];
int len;
public:
void input();
void sort();
};
void list::input()
{
cout<<"How many students do you want to input?"<<endl;
cin>>len;
for(int i=1;i<=len;i++)
{
cout<<"Input name"<<endl;
cin>>stu[i].name;
cout<<"Input last_name"<<endl;
cin>>stu[i].last_name;
cout<<"Input ID"<<endl;
cin>>stu[i].ID;
cout<<"Input mark"<<endl;
cin>>stu[i].mark;
}
}
void list::sort()
{
int ID1,lower=0,higher=0;
cout<<"Please Input the reference ID(1<=ID<=The total number of Student)"<<endl;
cin>>ID1;
for(int i=1;i<=len;i++)
{
if(stu[ID1].mark>stu[i].mark)
lower++;
if(stu[ID1].mark<stu[i].mark)
higher++;
}
cout<<"There're "<<lower<<"  Students' mark lower than reference ID's Student."<<endl;
cout<<"There're "<<higher<<"  Students' mark higher than reference ID's Student."<<endl;
}
void main()
{
list stu;
stu.input();
stu.sort();
}

Successful operation in VC6.0

计算4(pq+pr)-(4pq+qr)+(rp-3pr)a.-3pr b.-2pr c.2pr d.pr 写一个c 程序 Write a C programWrite a C program that receives from the command line a student ID (SXXXXX) to be used as a reference.Then the program asks the user to introduce the information about the results obtained by a set of students in th 用C语言写一个计算A+B的简单程序如题 c语言题一个 #define PR 10 #define PP PR+03 … int a=PP*c语言题一个#define PR 10#define PP PR+03…int a=PP*10;…当前a的值是多少?为什么?谢谢解答:) C语言中#defined PR 怎样用 C++写一个程序测出基因序列A+C的含量?还要从文件中读取基因序列? please___me soon.A.write on B.write down C.write at D.write to C语言程序:将一个正整数分解成若干素数的幂次方的乘积一个整数可唯一地分解为一些不同质因子的若干次方的乘积.即:对于一个大于1的整数a,可表示为:a = p1^e1*p2^e2…pr^er 用C语言写下面一个程序,最好用Switch语句write a program that tasks an intger keyd in from the terminal and extracts and extracts and displays each digit of the integer int English.So,if the user types int 932,the program should display. 以下叙述正确的是( ) A.在C程序中,main函数必须位于程序的最前面 B.C程序的每行中只能写一条语句 C.C语言本身没有输入输出语句 D.在对一个C程序进行编译的过程中,可发现注释中的拼写错误 C语言 有A,B,C三种球,A球3元一个,B球2元一个,C球1元一个.共有36个.总共100元,问有多少种买法(每种球写C语言程序 Have you finished ( ) your letters.A.writing B.to write C.write D.wrote 要写原因 C语言中的运算符号如图我以知道那个 圈里面一个加号的运算符号可以写成 ^或者^=那个 方框里面一个圈的好像是 +或者+=比如上面这个的程序可以写作if(ind > 7) ind -= 7; arg = a + *(piU + ind);pr = 写一个程序,由大至小依次输出顺序读入的三个整数a,b,c的值.是用C语言 想要写一个程序将十进制转换成二进制 用c写 计算机题目计算机C编一个程序,运行后 A=B(C+D) 从键盘输入一个整数,判断该数是否是一个质数的C程序怎么写 下列有关C程序的说法中,正确的是? A一个C程序中只能有一个主函数且位置任意 BA一个C程序中只能有一个主函数且位置任意 B一个C程序中可有多个主函数且位置任意C一个C程序中只能有一个主