fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define quick() ios_base::sync_with_stdio(false); cin.tie(0);
  4. #define pb push_back
  5. #define ll long long
  6. int mod=1000000007;
  7.  
  8. struct SinhVien{
  9. string msv,ten,lop,ns;
  10. float gpa;
  11. };
  12.  
  13. void nhap(SinhVien a[],int n){
  14. for(int i=0;i<n;i++){
  15. cin.ignore();
  16. getline(cin,a[i].ten);
  17. cin>>a[i].lop>>a[i].ns>>a[i].gpa;
  18.  
  19. a[i].msv="B20DCCN"+string(3-to_string(i+1).size(),'0')+to_string(i+1);
  20. if(a[i].ns[1]=='/'){
  21. a[i].ns="0"+a[i].ns;
  22. }
  23. if(a[i].ns[4]=='/'){
  24. a[i].ns.insert(3,"0");
  25. }
  26. }
  27. }
  28. void in(SinhVien a[],int n){
  29. for(int i=0;i<n;i++){
  30. stringstream ss(a[i].ten);
  31. string x,res="";
  32. while(ss>>x){
  33. x[0]=toupper(x[0]);
  34. for(int i=1;i<x.size();i++) x[i]=tolower(x[i]);
  35. res+=x+' ';
  36. }
  37. res.pop_back();
  38.  
  39. cout<<a[i].msv<<' '<<res<<' '<<a[i].lop<<' '<<a[i].ns<<' '<<
  40. fixed<<setprecision(2)<<a[i].gpa<<endl;
  41. }
  42. }
  43. int main(){
  44. struct SinhVien ds[50];
  45. int N;
  46. cin >> N;
  47. nhap(ds, N);
  48. in(ds, N);
  49. return 0;
  50. }
Success #stdin #stdout 0.01s 5456KB
stdin
1

nGuyEn  vaN    biNH

D20CQCN01-B

2/12/2002

3.1
stdout
B20DCCN001 �8�V�8�V�8�V@�Y�@�Y�@�Y�@�Y�@�Y�O�Y�L�U��@�Y��Y��8�V����Y�L�U�Y��Y� F�U��E�U��E�U���I�����Y�P�7�V@Z�s�7�V��Y�
B20DCCN001�Y�Z�nGuyEn Z�vaNHZ�hZ��Z��Z��Z��Z�Z�0Z�XZ�xZ��Z��Z��Z�Z� Z�@Z�hZ��Z��Z��Z��Z�Z�0Z�PZ�xZ��Z��Z��Z�Z� Z�@Z�`Z��Z��Z��Z��Z�Z�0Z�PZ�pZ��Z��Z��Z��Z� Z�@Z�`Z��Z��Z��Z��Z�Z�0Z�PZ�pZ��Z��Z��Z��Z�Z�@Z�`Z��Z��Z��Z��Z�	Z�(	Z�P	Z�
Z�
Z�p	Z��X��U��	Z�I�I�	Z�Pt�U��Z��	Z���	Z����
Z��8
Z�D�`
Z��ض�
Z����
Z���
Z�rlr@�
Z����Z�(Z��U�HZ�
恛U�pZ�Z��U��Z��ʽ�U��Z���Z��	Z��Z��qU�\�Z�s�U�恛U�8Z��XZ�h��Z�N+`��\�Z���)�Z���������]U��Z��U���U�
Z��(
Z�H
Z�
Z��
Z�h
Z��
Z��
Z��
Z�