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 5424KB
stdin
1

nGuyEn  vaN    biNH

D20CQCN01-B

2/12/2002

3.1
stdout
B20DCCN001 �kh͉U�kh͉U�kh͉U0+�z�0+�z�0+�z�0+�z�0+�z�?+�z�L�,��0+�z��,�z��kh͉U���+�z�L�,��z��*�z� F�,��E�,��E�,��AZ���,�z�P6h͉U0H�z�s5h͉U�,�z�
B20DCCN001�,�z��,�z�nGuyEn-�z�vaN8-�z�X-�z�x-�z��-�z��-�z��-�z�.�z� .�z�H.�z�h.�z��.�z��.�z��.�z��.�z�/�z�0/�z�X/�z�x/�z��/�z��/�z��/�z�0�z� 0�z�@0�z�h0�z��0�z��0�z��0�z��0�z�1�z�01�z�P1�z�x1�z��1�z��1�z��1�z�2�z� 2�z�@2�z�`2�z��2�z��2�z��2�z��2�z�3�z�03�z�P3�z�p3�z��3�z��3�z��3�z��3�z� 4�z�@4�z�`4�z��4�z��4�z��4�z��4�z�5�z�05�z�P5�z�p5�z��5�z��5�z��5�z��5�z�6�z�@6�z�:�z�7�z�`6�z��X��,��6�z�I�I�6�z�Pt�,��9�z��6�z���6�z����7�z��(7�z�D�P7�z��ضp7�z����7�z���7�z�rlr@�7�z�����7�z�8�z��,�88�z�
�y,�`8�z�9�z��,��8�z��ʽ�,��8�z���8�z��6�z��8�z��O,�\�9�z�s�,��y,�(9�z��H9�z�h�p9�z�N+`��\�9�z���)�9�z���������;,��9�z��,��y,��9�z��:�z�8:�z�:�z�p:�z�X:�z��:�z��:�z��:�z�