正在加载图片...
872 LJU 791 BPJWIA 580 AGMVY 619 NAFL 233 PDJWXK 样例输出 6 410 567 822 834 791 233 #include<bits/stdc+.h>/C+的万能头文件 using namespace std; const int N=5;/有5名学生 struct Book intD,/图书的编号 char author[30;∥存储作者 int main() { int m; cin>>m; inti,j; Book b[1005];/∥最多有1000本书(多设几个空间) int count[30]={0;/存储每个作者的出书本数 for(i=0;i<=m-l;i++)》 cin>b[.ID>b[).author,/输入编号和作者 } int len, for(i=0;i<=m-1;i++) { len strlen(b[i].author);872 LJU 791 BPJWIA 580 AGMVY 619 NAFL 233 PDJWXK 样例输出 P 6 410 567 822 834 791 233 #include <bits/stdc++.h> //C++的万能头文件 using namespace std; const int N = 5;//有 5 名学生 struct Book { int ID;//图书的编号 char author[30]; //存储作者 }; int main( ) { int m; cin >> m; int i,j; Book b[1005]; //最多有 1000 本书(多设几个空间) int count[30] = {0}; //存储每个作者的出书本数 for(i = 0 ; i <= m -1; i ++) { cin >> b[i].ID >> b[i].author; //输入编号和作者 } int len; for(i = 0 ; i <= m-1; i ++) { len = strlen(b[i].author);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有