生成10的88次方随机数

// -*- coding: utf-8 -*-
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
int main() {
    // 初始化随机数生成器
    srand((unsigned)time(NULL));
    // 生成1到100之间的随机数
    int randomNumber = rand() % 100 + 1;
    // 计算10的randomNumber的88次方
    double result = pow(10, randomNumber * 88);
    printf("10的 %d 次方是: %e\n", randomNumber, result);
    return 0;
}

 

posted @ 2025-03-26 16:53  华腾智算  阅读(33)  评论(0)    收藏  举报
https://damo.alibaba.com/ https://tianchi.aliyun.com/course?spm=5176.21206777.J_3941670930.5.87dc17c9BZNvLL