Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <time.h>
- using namespace std;
- #include<string>
- int getdigits(int i, int y)
- {
- int z=0;
- if (i==0)
- {
- z=y/1000;
- }
- else if (i==1)
- {
- z=(y%1000)/100;
- }
- else if (i==2)
- {
- z=y%1000;
- z=(z%100)/10;
- }
- else if (i==3)
- {
- z=y%1000;
- z=z%100;
- z=z%10;
- }
- return z;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- int x[4];
- int z[4];
- int y=0;
- srand(time(NULL));
- for (int i=0; i<4; i++)
- {
- if (x[i] == z[0] }
- {
- if x[i]==z[1]
- if (x[i] == z[2])
- if x[i] == z[3]
- z = 1;
- x = 0;
- y = 0;
- }
- while (position < z)
- {
- if (z == position)
- x ++;
- y ++;
- x++;
- }
- x[i] = rand() % 10;
- }
- cin>>y;
- for (int i=0; i<4; i++)
- {
- z[i]=getdigits(i, y);
- }
- cout<<z[0]<<endl;
- cout<<z[1]<<endl;
- cout<<z[2]<<endl;
- cout<<z[3]<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment