#include <iostream> using namespace std; int main() { int temp; int numbers[6] = {0}; for(unsigned int i=0 ; i<6 ; i++) { cout<< "unesi jedan broj (1-6) :"; cin>> temp; cout<< endl; numbers[temp-1]++; } for(unsigned int i=0 ; i<6 ; i++) { cout<< "broj " << i+1 << " : " << numbers[i] << " puta" << endl; } return 0;}
5 5 5 5 4 6
unesi jedan broj (1-6) : unesi jedan broj (1-6) : unesi jedan broj (1-6) : unesi jedan broj (1-6) : unesi jedan broj (1-6) : unesi jedan broj (1-6) : broj 1 : 0 puta broj 2 : 0 puta broj 3 : 0 puta broj 4 : 1 puta broj 5 : 4 puta broj 6 : 1 puta
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!