Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cout << "answer question No.7\n\n";
- char arr[SIZE2], i;
- bool flag = true;
- cout << "please enter " << SIZE2 << " characters: ";
- for (i = 0; i < SIZE2; i += 1)
- {
- cin >> arr[i];
- if ( arr[i] != arr[i - 1])
- flag = false;
- }
- if (flag)
- cout << "the chars are the same!" << endl;
- else
- cout << "the chars are difference!" << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment