---
title: "随机数"
author: "solem"
date: "2010-03-17T22:10:56Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-03-17T22:11:41Z"
id: 618476
url: "https://solem.iteye.com/blog/618476"
---

vuser_init()
{
int id;
char *vuser_group;
long file;
int rnd; 
srand(time(NULL)); 
rnd = rand()%100;
lr_whoami(&id, &vuser_group, NULL);
if (rnd <= 80)
{
    file=fopen("c://test.txt","at+");
    fprintf(file,"%d", rnd);
    fprintf(file,"%d\n", id);
    fclose(file);
}
else if (rnd > 80)
{
    file=fopen("c://test.txt","at+");
    fprintf(file,"%d", rnd);
        fprintf(file,"%d\n", id);
    fclose(file); 
}
        return 0;
}