[ create a new paste ] login | about

Link: http://codepad.org/UkokVRjF    [ raw code | output | fork ]

C++, pasted on Jan 5:
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;
}


Output:
1
Sign '.' was typed = 1 times.


Create a new paste based on this one


Comments: