Advertisement
RnD

ray3

RnD
Nov 21st, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <windows.h>
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8.     string sName[21];
  9.     cout << "Enter names: ";
  10.     sName[0]="0";
  11.  
  12.     for(int i=1;i<21;i++){
  13.         if(sName[i-1]=="q"){
  14.             sName[i-1]="\0";
  15.             break;
  16.         }
  17.         else{
  18.             cin>>sName[i];
  19.             cout<<endl;
  20.         }
  21.     }
  22.  
  23.     cout << endl;
  24.     for(int i=1;i<21;i++){
  25.         if(sName[i]!="\0"){
  26.             cout << sName[i] << endl;
  27.         }
  28.     }
  29.  
  30.     system("pause>nul");
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement