Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <math.h>
  4. #include <time.h>
  5. using namespace std;
  6. void main()
  7. {
  8.     srand(time(NULL));
  9.     setlocale(LC_ALL,"Russian");
  10.     int mass[100],count=0;
  11.     for(int i=0;i<100;i++)
  12.     {
  13.         mass[i]=(rand()%201)-100;
  14.         if(mass[i]>=0)
  15.         {
  16.             count++;
  17.         }
  18.         else
  19.         {
  20.             if(count>5)
  21.                 cout<<i-count<<endl;
  22.             count=0;
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement