Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <array>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main(void)
- {
- array<array<int,20>,10>image;
- srand(time(NULL));
- float a=0;
- for(int x=0;x<10;x++){
- for(int y=0;y<20;y++){
- image[x][y]=rand()%256;
- image[x][y]+=30;
- if(image[x][y]>255)
- {
- image[x][y]=255;
- }
- if(image[x][y]>=120){
- cout<<"X";
- }
- else{
- cout<<".";
- a++;
- }
- }
- cout<<endl;
- }
- a=(a/200.0)*100.0;
- cout<<a<<"%"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement