1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream> using namespace std; int main() { char x[]="dfr.c$f."; int i = 0, y = 0; do { if (x[i++] == '.') y++; } while (x[i]!='$'); cout<<"Sign '.' was typed = "<<y<< " times." << "\n"; return 0; }
1
Sign '.' was typed = 1 times.