Compile Error
foo.c: In function 'main': foo.c:8:25: error: invalid operands to binary % (have 'int' and 'double') int ans=(int)pow(k+1,n)%(10e9+7); ~~~~~~~~~~~~~~~^~~~~~~~~ foo.c:7:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&k); ^~~~~~~~~~~~~~~~~~~
代码
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void)
{
int n,k;
scanf("%d%d",&n,&k);
int ans=(int)pow(k+1,n)%(10e9+7);
printf("%d",ans);
}
信息
- 递交者
- 类型
- 自测
- 题目
- P1005 hitwh 2019 新生赛 F Ramen and his faculty
- 语言
- C
- 递交时间
- 2020-12-20 17:45:13
- 评测时间
- 2020-12-20 17:45:13
- 评测机
- 分数
- 0
- 总耗时
- 0ms
- 峰值内存
- 0 Bytes