首页 > 试题广场 >

学生查询

[编程题]学生查询
  • 热度指数:7322 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32M,其他语言64M
  • 算法知识视频讲解
输入n个学生的信息,每行包括学号、姓名、性别和年龄每一个属性使用空格分开。最后再输入一学号,将该学号对应的学生信息输出。

输入描述:
测试数据有多组,第一行为样例数m。对于每个样例,第一行为学生人数n(n不超过20),接下来n行每行4个整数分别表示学号、姓名、性别和年龄,最后一行表示查询的学号。


输出描述:
输出m行,每行表示查询的学生信息,格式参见样例。
示例1

输入

1
4
1 李江 男 21
2 刘唐 男 23
3 张军 男 19
4 王娜 女 19
2

输出

2 刘唐 男 23
头像 KDDA十三尧十三
发表于 2022-02-10 15:07:52
#include<iostream> using namespace std; typedef struct Student {     string name;     展开全文
头像 在考古的小鱼干很有气魄
发表于 2023-03-13 11:27:51
#include <iostream> #include <algorithm> #define MAX 21 using namespace std; typedef struct{ int no; string name; string gender; int 展开全文
头像 给我就亿下
发表于 2023-03-25 19:59:10
#include <iostream> using namespace std; struct Student { int id; string name; string sex; int age; }; Student stu[21]; int main () { i 展开全文
头像 bigbigcake
发表于 2024-03-10 14:25:30
#include <iostream> using namespace std; class person { public: string no; string name; string sex; int age; public: voi 展开全文
头像 sum~
发表于 2022-02-28 18:05:05
//C++使用map实现学生查询 //映射关系为:学号-->学生所有信息 #include #include #include #include using namespace std; int main() { int m, n; string str; scanf("%d", &a 展开全文

问题信息

上传者:小小
难度:
47条回答 4695浏览

热门推荐

通过挑战的用户

查看代码