Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
763 B
3
Indexable
Never
#include "types.h"
#include "user.h"
#include "fcntl.h"


void dummy(int n){
    printf(1, "------------------------begin function n : %d ----------------------------\n", n);
    if(n == 0 ){
        return;
    }
    int arr[15000];
    for(int i = 0 ; i < 15000 ; i++){
        arr[i] = i;
        sleep(10);
    }
    printf(1, "------------------------called %d times----------------------------\n", n);
    dummy(n-1);
    int count = 0;
    for(int i = 0 ; i < 15000 ; i++){
        if(arr[i] != i){
            count = 1;
        }
    }
    printf(1, "------------------------------%d : %d---------------------------------\n", n, count);
    return; 

}

int main(int argc , char * argv[]){
    // dummy_easy();
    int n = 10;
    dummy(n);
    exit();
}