djelad1

Untitled

Nov 15th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. cout << "answer question No.7\n\n";
  2. char arr[SIZE2], i;
  3. bool flag = true;
  4.  
  5. cout << "please enter " << SIZE2 << " characters: ";
  6. for (i = 0; i < SIZE2; i += 1)
  7. {
  8. cin >> arr[i];
  9. if ( arr[i] != arr[i - 1])
  10. flag = false;
  11. }
  12. if (flag)
  13. cout << "the chars are the same!" << endl;
  14. else
  15. cout << "the chars are difference!" << endl;
  16. system("pause");
  17. }
Advertisement
Add Comment
Please, Sign In to add comment