Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(){
- int tam, num, n;
- srand((unsigned)time(NULL));
- FILE *input;
- input = fopen("2.in", "w");
- if(input==NULL){
- printf("Erro1\n");
- exit(1);
- }
- scanf("%d", &tam);
- while(tam--){
- num = rand()%9;
- fprintf(input, "%d\n", num);
- }
- fclose(input);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement