include iostream using namespace std int main int argc char argv const

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
const int N = 15;
char str[N], newstr[N], symbol;
int count = 0;
cout << "Please input text (max 15 symbols): ";
cin >> str;
for(int i = 0; i < 15; i++){
symbol = str[i];
if(symbol == '.'){
symbol = '_';
count++;
}
newstr[i] = symbol;
}
cout << "\nReplace String: " << newstr << "\n" << "Count Replace: " << count << endl;
system("PAUSE");
return 0;
}