Lightoj1015【基础题】
来源:互联网 发布:win8.1改mac地址 编辑:程序博客网 时间:2024/05/18 12:42
题意:
计算输入数>0的所有和;
思路:
直接干。。。
#include<cstdio>#include<queue>#include<map>#include<string>#include<string.h>#include<iostream>#include<algorithm>using namespace std;typedef long long LL;const int INF=0x3f3f3f3f;const LL mod=1e9+7;const int N=1e3+10;int a[N];int n;int main(){ int T,cas=1; scanf("%d",&T); while(T--) { scanf("%d",&n); int x,sum=0; for(int i=0;i<n;i++) { scanf("%d",&x); if(x<0) continue; sum+=x; } printf("Case %d: %d\n",cas++,sum); } return 0;}
0 0
- Lightoj1015【基础题】
- LightOJ1015 (水题)
- 基础题
- 基础题
- 基础题
- 基础题
- 面试基础题--J2SE基础
- Java基础-day01-基础题
- poj2524(并查集基础基础基础题)
- 蓝桥杯 基础练习 闰年判断【基础题】
- 基础的01字串 蓝桥杯基础题
- java 基础题 很基础, 很有趣
- java基础题
- java面试基础题
- Java 基础题1
- java基础题
- net基础题(1)
- java经典基础题
- Servlet3.0新特性之文件上传
- 【DBN】Deep Belief Network简介
- 自定义view 基本步骤
- 【caffe-Windows】caffe+VS2013+Windows无GPU快速配置教程
- LVM磁盘管理
- Lightoj1015【基础题】
- 剑指offer面试题63:二叉搜索树的第k个节点 Java实现
- Android中IntentService详解
- #java.util.Random简介
- tri树模板
- flex访问java服务器的httpservice的沙箱处理
- 关于@SuppressWarnings
- struts2重定向时传递参数的实现!以及传递参数为中文时的乱码问题解决!
- 洛谷 P1032 [NOIP2002 T2] 字串变换