fork download
  1. #include<iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5. int main() { string word[5]; int i; for(i=0; i<5; i++) { cout<<"Enter the word"<<i<<endl; cin>>word[i]; } for(i=0; i<5; i++) { cout<<i+1<<"."<<word[i]<<endl; } return 0; }
Success #stdin #stdout 0.02s 2860KB
stdin
Object
Oriented
Programming
Using
C++
stdout
Enter the word0
Enter the word1
Enter the word2
Enter the word3
Enter the word4
1.Object
2.Oriented
3.Programming
4.Using
5.C++