1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
int main()
{
char data[]={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t};//this keeps giving error, did i even do i right?
char letter[20];
int max = 0;
int min=0;
for(int i = 0; i < data; ++i)
cout<<data[i]<<endl;
{
if (letter[i] > letter[max])
max = i;
if (letter[i] < letter[min])
min=i;
}
cout << "largest element index: " << max<<endl;
cout << " samllest element index: " <<min <<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
| |