01数字雨

· · 休闲·娱乐

#include <stdlib.h>
#include <time.h>
#include <Windows.h>
#include<iostream>
int main() 
{ 
    srand((unsigned)time(NULL)); 
    system("color 02"); 
    while (1)
    { 
        for(int k = 0; k <= 99; k++) 
        {
            if(rand() % 5 >= 3)
            {
                printf("%-*d", rand() % 3 + 2, k % 2);
            } 
        }
        printf("\n"); 
        Sleep(50);
    }
    return 0;
}