签到题 地址:https://www.nowcoder.com/pat/6/problem/4078

 #include<iostream>
#include<cstdio>
using namespace std;
int main(){
int A[]={};//存分类数据
int a[]={};//标记是否有数据个数
int t;
int flag=;//A3的标记变量
int num=;//A4的统计变量
scanf("%d",&t);
//IF处理操作
for(int i=;i<t;i++){
int temp;
scanf("%d",&temp);
if((temp%==)&&(temp%==)){
a[]=;
A[]+=temp;
}
if(temp%==){
a[]=;
if(flag==){
A[]+=temp;
flag=;
}else{
A[]-=temp;
flag=;
}
}
if(temp%==){
a[]=;
A[]++;}
if(temp%==){
a[]=;
A[]+=temp;
num++;
}
if(temp%==){
a[]=;
A[]=A[]>temp?A[]:temp;
}
}
//格式输出
for(int i=;i<;i++){
if(a[i]){
if(i==){
printf("%.1lf",A[i]*1.0/num);
}else{
printf("%d",A[i]);
} }else{
printf("N");
}
if(i!=)printf(" ");
}
return ;
}

最新文章

  1. [No000016]为什么假期计划总是做不到?
  2. webpack入坑之旅(三)webpack.config入门
  3. 剑指offer--面试题15
  4. 例说C#深拷贝与浅拷贝
  5. 【转】(DT系列一)DTS结构及其编译方法----不错
  6. Qt多国语言QT_TR_NOOP和QT_TRANSLATE_NOOP
  7. 2015第10周五CSS—2
  8. EALayout 实践
  9. 我们的代码为什么要压缩成7z?
  10. ORACLE 触发器 基础
  11. 如何为Windows XP / Windows7-32bit / Windows7-64bit安装capicom.dll
  12. 如何使用postman传数组数据
  13. Python图片裁剪
  14. IdentityServer4-主题
  15. java三大工厂结果总览
  16. Java构建指定大小文件
  17. 【java】自定义异常类
  18. Spring学习笔记之Container overview
  19. Django中更新多个对象数据与删除对象的方法
  20. Java虚拟机19:再谈四种引用状态

热门文章

  1. 页面上怎么使用svg
  2. 美团Leaf——全局序列生成器
  3. PHP date_modify() 函数
  4. luogu P5826 【模板】子序列自动机 主席树 vector 二分
  5. luogu P3920 [WC2014]紫荆花之恋
  6. 区块链钱包开发 - USDT - 三、实战(nodejs版本)
  7. tensorflow2.0 实现gpu和cpu切换
  8. Android Studio局部管理器
  9. 基于深度学习的人脸识别系统Win10 环境安装与配置(python+opencv+tensorflow)
  10. SpringBoot实现发送邮件