POJ-2209
来源:互联网 发布:海洋cms仿迅影网模板 编辑:程序博客网 时间:2024/06/03 19:55
#include<iostream>
#include<math.h>
using namespace std;
int main(int argc, char *argv[]){
int sonNum;
cin>>sonNum;
int exponent;
cin>>exponent;
int sum=0;
for(int i=0; i<sonNum; i++){
int potential;
cin>>potential;
int potentialEx=pow(1.0*potential, exponent);
if(potentialEx>0){
sum+=potentialEx;
}
}
cout<<sum<<endl;
return 0;
}
#include<math.h>
using namespace std;
int main(int argc, char *argv[]){
int sonNum;
cin>>sonNum;
int exponent;
cin>>exponent;
int sum=0;
for(int i=0; i<sonNum; i++){
int potential;
cin>>potential;
int potentialEx=pow(1.0*potential, exponent);
if(potentialEx>0){
sum+=potentialEx;
}
}
cout<<sum<<endl;
return 0;
}
0 0
- POJ-2209
- POJ 2209 The King
- poj 2209 The King
- POJ 2209求和最大
- poj 2209 The King
- poj 2209 The King
- POJ
- poj
- POJ
- POJ
- poj
- poj
- POJ
- POJ
- poj
- POJ
- POJ
- POJ
- js定时器 setTimeout
- sharepoint 2016 学习系列篇(15)-自定义列表应用篇-(4)数据权限配置
- Binder
- Android Java连接MySQL数据库
- Android6.0新特性??
- POJ-2209
- hdu 2222 Keywords Search ac自动机
- 使用HttpURLConnection发送Post/Get请求
- JAVAIO之压缩流(zip,Gzip)
- 线性表---顺序存储结构与链式存储结构比较
- C语言——getc()和putc()
- C#中的string与stringbuilder有什么区别
- Oracle 去重复的数据
- UI - Block