c++

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <iostream>
#include <cstring>
using namespace std;
int main ()
{  
    bool x1;
    bool x2;
    int size1;
    int size2;
    size1=100;
    size2=100;
    char arrway1[size1];
    char arrway2[size2];
      do
    {
        cout <<"input word"<<endl; 
        cin>>arrway1[size1];
        cin>>arrway2[size2];
if((arrway1[size1]> 'a' && arrway1[size1]< 'z') || (arrway1[size1] > 'A' &&  arrway1[size1]< 'Z'))
{
                   x1=true;
                  }
                  if((arrway2[size2]> 'a' && arrway2[size2]< 'z') || (arrway2[size2] > 'A' &&  arrway2[size2]< 'Z'))
                  {
                                 x2=true;
                                 }
                                 else
                                 {
                                     cout <<"error"<<endl;
                                 }              
                                 }
                    while(x1==true||x2==true);             
                   if(arrway1[size1]==arrway2[size2])
                   {                                
                    cout <<arrway1[size1] <<endl;
                    cout <<arrway1[size2] <<endl;
                    }                                             
                         else 
                         {
                         cout <<"Does t equal the leftmost"<<endl;     
                          }                               
                          return 0;  
                                } 
                                                             

need create c++ program input words only from alfabet,look like ..
input >> fastcar>>fastercar;
output >>fast;
input >>dogs >> cats;
output>> Does not equal the leftmost;
input>>street>>streets;
output>>stre;
cin>>arrway1[size1];
index out of bounds
Topic archived. No new replies allowed.