#8594: (C語言) 打法參考


ssssxxxx994422 (LoS-Light)


#include <stdio.h>
#include <math.h>
#include <time.h>
int main(){
int a1,a2,b,c,d1,d2,v1,v3,v4;
double v2;
scanf("%d%d%d%d%d%d", &a1,&a2,&b,&c,&d1,&d2);
v1=pow(a1,a2);
v2=sqrt(b);
v3=(c>0)?c:-c;
srand(time(NULL));
v4=(rand()%((d2-1)-d1+1))+d1; //請取一個整數亂數x(a<=x<b)也就是說(a<=x<=b-1)(上傳編譯時請把註解用掉) 
printf("%d\n%.3lf\n%d\n%d\n", v1,v2,v3,v4);
return 0;
}