坐公交

解法:略

 #include<stdio.h>
#include<string>
#include<iostream>
#include<math.h>
#include<time.h>
#include <stdlib.h>
#include<algorithm>
using namespace std;
int main()
{ int a,b,c;
while(cin>>a>>b>>c)
{
cout<<min({a,b,c})<<endl;
}
return ;
}

初见

解法:模拟

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
int k;
while(~scanf("%d",&k))
{
int i=;
double sum=;
while(sum<k)
{
i++;
// cout<<sum<<endl;
sum+=(double)/i*(1.0); }
printf("%d\n",i);
}
return ;
}

问卷调查

解法:模拟

#include<stdio.h>
#include<string>
#include<iostream>
#include<math.h>
#include<time.h>
#include <stdlib.h>
#include<algorithm>
using namespace std;
struct P
{
double x;
// string s;
// int pos;
}He[][];
int main()
{
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
int n,m;
while(cin>>n>>m)
{
string s[];
for(int i=;i<n;i++)
{
cin>>s[i];
}
for(int i=;i<m;i++)
{
int xa=,xb=,xc=,xd=;
for(int j=;j<n;j++)
{
if(s[j][i]=='A')
{
xa++;
}
else if(s[j][i]=='B')
{
xb++;
}
else if(s[j][i]=='C')
{
xc++;
}
else if(s[j][i]=='D')
{
xd++;
}
}
// cout<<xa<<" "<<xb<<" "<<xc<<" "<<xd<<endl;
He[i][].x=(double)xa/(xa+xb+xc+xd);
He[i][].x=(double)xb/(xa+xb+xc+xd);
He[i][].x=(double)xc/(xa+xb+xc+xd);
He[i][].x=(double)xd/(xa+xb+xc+xd);
}
for(int i=;i<m;i++)
{
for(int j=;j<;j++)
{
if(j==)
{
printf("%.2f",He[i][j].x);
}
else
{
printf(" %.2f",He[i][j].x);
}
}
puts("");
}
}
return ;
}

2014江西理工大学C语言程序竞赛初级组的更多相关文章

  1. 2014江西理工大学C语言程序竞赛高级组

    Beautiful Palindrome Number 题意:求N里面有多少个符合要求的数字(数字要求:回文数,且前一半部分是不严格递增) 解法:打表 #include<bits/stdc++. ...

  2. 2018年江西理工大学C语言程序设计竞赛(初级组)一

     C语言竞赛初级组第一.二场答案:https://www.cnblogs.com/xingkongyihao/p/10046918.html  A: 逆序对 时间限制: 1 s      内存限制:  ...

  3. 2014江西理工大学C语言程序设计竞赛高级组题解

    1001 Beautiful Palindrome Number 枚举回文数字前半部分,然后判断该数字是否满足,复杂度为O(sqrt(n))! 1002 Recovery Sequence  本题的核 ...

  4. 2017年江西理工大学C语言程序设计竞赛(初级组)

    问题 A: Petr的盒子(初) #include <iostream> #include <stdio.h> #include <algorithm> using ...

  5. 2017年江西理工大学C语言程序设计竞赛(高级组)

    问题 A: 求近似值 #include <stdio.h> #include <time.h> #include <stdlib.h> using namespac ...

  6. 2018年江西理工大学C语言程序设计竞赛(高级组) 三角平方数

    题目描述 三角数:形如图a,圆点摆放成等边三角形的数字,则为三角数. (图a) 平方数:形如图b,小方块摆放成正方形的数字,则为平方数. (图b) 那么如果一个数字既是三角形数又是平方数,则称为三角平 ...

  7. 2018年江西理工大学C语言程序设计竞赛高级组部分题解

    B Interesting paths 考察范围:组合数学 此题是机器人走方格的变种,n*m的网格,从(1,1)走到(n,m),首先可以明确,水平要走m-1格,竖直要走n-1格,则走到目的地的任意一条 ...

  8. 2016年江西理工大学C语言程序设计竞赛(初级组)

    问题 A: 木棒根数 解法:把所有的情况保存下来,加一下就好 #include<bits/stdc++.h> using namespace std; map<char,int> ...

  9. 2015年江西理工大学C语言程序设计竞赛(初级组)

    JankTao相亲记 解法:排序 #include<stdio.h> #include<string.h> #include<iostream> #include& ...

随机推荐

  1. 转:NodeJS、NPM安装配置步骤

    1.windows下的NodeJS安装是比较方便的(v0.6.0版本之后,支持windows native),只需要登陆官网(http://nodejs.org/),便可以看到下载页面.  2.下载完 ...

  2. ofbiz进击 第五节。 --OFBiz配置之[general.properties] 共有属性的分析(含email)

    文件内容如下 unique.instanceId=ofbiz1     #--为JobManger方法提供实例的ID(必须小于20个字符)    currency.uom.id.default=USD ...

  3. Spring中Bean的配置:基于XML文件的方式

    Bean的配置一共有两种方式:一种是基于XML文件的方式,另一种是基于注解的方式.本文主要介绍基于XML文件的方式 <bean id="helloWorld" class=& ...

  4. android linux

    app 权限 - shell 权限2000 system root .adb 指令 a.查看链接终端设备 adb devices b.进入设备终端 adb shell ;多台设备 adb -s 设备号 ...

  5. C#写好的类库dll怎么在别人调用的时候也能看到注释?

    菜单 Project -> 'xxxx' Properties -> Build -> Output -> 勾上 XML Documentation file

  6. 某个系统配置文件 用户层的SQL

    SELECT fpo.user_profile_option_name, fpv.level_id, fpv.level_value, fpv.profile_option_value, fu.use ...

  7. Delphi中SQL批量插入记录

    http://www.cnblogs.com/azhqiang/p/4050331.html 在进行数据库操作时, 我们经常会遇到批量向数据库中写入记录的情况. 在这里我提供3种操作方式:   1.  ...

  8. PAT乙级 1009. 说反话 (20)

    1009. 说反话 (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 给定一句英语,要求你编写程序,将句中 ...

  9. ubuntu下配置SVN服务器

    自己买的阿里云服务器.可是我老感觉没有SVN上传代码下载代码太不方便!决定配置个SVN服务器! 1.安装Subversion $ sudo apt-get install subversion $ s ...

  10. Android之自定义生成彩色二维码

    先导个zxing.jar包 下面是xml布局 activity_main.xml <RelativeLayout xmlns:android="http://schemas.andro ...