第三题

#include
using namespace std;
int main()
{
 int n, i;
 cout << “The number of stones:” << endl;
 cin >> n;
 char *stone = NULL, *p;
 stone = new char[n];
 for (i = 0; i < n; i++)
 {
  cin >> stone[i];
 }
 int m = 0;
 for (int i = 0; i < n-1; i++)
 {
  if (stone[i] == stone[i+1])
  {
   m = m + 1;
  }
 }
 cout << “The number of the taking stones:” << endl;
 cout<  system(“pause”);
}

你可能感兴趣的:(第三题)