中秋节怎么能不做题目呢?所以,为了找找感觉,做了着一套题目,现在没有表明出处,以后填坑;
先整前四道简单题;
A 签到题
Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.
What is the least number of flagstones needed to pave the Square? It’s allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It’s not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.
Input
The input contains three positive integer numbers in the first line: n,  m and a (1 ≤  n, m, a ≤ 109).
Output
Write the needed number of flagstones.
Examples
Input
6 6 4
Output
4

题意:简单
解题:就是去算

#include<iostream>
#include<cstdio>
#define ll long long
using namespace std;
ll x,y;
int main()
{
   
	int n,m,a;
	scanf("%d%d%d",&n,&m,&a);
	x=n/a;//边
	if(n%a!=0)//不够补1
	{
   
		x++;
	}
	y=m/a;//同理
	if(m%a!=0)
	{
   
		y++;
	}
	x=x*y;//最后乘积即答案;
	printf("%lld\n",x);
	return 0;
}

B题
How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We’re assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the bottom one by half a card length, and the bottom one overhang the table by a third of a card length, for a total maximum overhang of 1/2 + 1/3 = 5/6 card lengths. In general you can make n cards overhang by 1/2 + 1/3 + 1/4 + … + 1/(n + 1) card lengths, where the top card overhangs the second by 1/2, the second overhangs tha third by 1/3, the third overhangs the fourth by 1/4, etc., and the bottom card overhangs the table by 1/(n + 1). This is illustrated in the figure below.

Input
The input consists of one or more test cases, followed by a line containing the number 0.00 that signals the end of the input. Each test case is a single line containing a positive floating-point number c whose value is at least 0.01 and at most 5.20; c will contain exactly three digits.
Output
For each test case, output the minimum number of cards necessary to achieve an overhang of at least c card lengths. Use the exact output format shown in the examples.
Sample Input
1.00
3.71
0.04
5.19
0.00
Sample Output
3 card(s)
61 card(s)
1 card(s)
273 card(s)

题意:水题:
解题:

#include <iostream>
#include<cstdio>
using namespace std;
double a;
int main()
{
   
    double sum=0.0;
    double s[15000];
    s[1]=1.0/2.0;
    for(int i=2;i<=15000;i++)//求出它每个的值,斐波那契思想
    {
   
        s[i]=s[i-1]+(double)1/(i+1);
    }
    while(cin>>a)
    {
   
        if(a==0.00)
            break;
        for(int i=1;i<1500;i++)
        {
   
            if(a<=s[i])
            {
   
                cout<<i<<" card(s)"<<endl;
                break;
            }
        }
    }
	return 0;
}

C题
Larry graduated this year and finally has a job. He’s making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial portfolio and solve his financing problems. The first step is to figure out what’s been going on with his money. Larry has his bank account statements and wants to see how much money he has. Help Larry by writing a program to take his closing balance from each of the past twelve months and calculate his average account balance.
Input
The input will be twelve lines. Each line will contain the closing balance of his bank account for a particular month. Each number will be positive and displayed to the penny. No dollar sign will be included.
Output
The output will be a single number, the average (mean) of the closing balances for the twelve months. It will be rounded to the nearest penny, preceded immediately by a dollar sign, and followed by the end-of-line. There will be no other spaces or characters in the output.
Sample Input
100.00
489.12
12454.12
1234.10
823.05
109.20
5.27
1542.25
839.18
83.99
1295.01
1.75
Sample Output
$1581.42

求平均值:

#include<stdio.h>
int main()
{
   
    int n=12;
    double a[22];
    double y;
    for(int i=1;i<=12;i++)
    {
   
        scanf("%lf",&a[i]);
        y=y+a[i];
    }
    y=y/12.0;//注意要12.0//如果是12 会错
    printf("$%.2lf\n",y); 
    return 0;
}

D
A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked.
One night, the jailer gets bored and decides to play a game. For round 1 of the game, he takes a drink of whiskey,and then runs down the hall unlocking each cell. For round 2, he takes a drink of whiskey, and then runs down the
hall locking every other cell (cells 2, 4, 6, ?). For round 3, he takes a drink of whiskey, and then runs down the hall. He visits every third cell (cells 3, 6, 9, ?). If the cell is locked, he unlocks it; if it is unlocked, he locks it. He
repeats this for n rounds, takes a final drink, and passes out.
Some number of prisoners, possibly zero, realizes that their cells are unlocked and the jailer is incapacitated. They immediately escape.
Given the number of cells, determine how many prisoners escape jail.
Input
The first line of input contains a single positive integer. This is the number of lines that follow. Each of the following lines contains a single integer between 5 and 100, inclusive, which is the number of cells n.
Output
For each line, you must print out the number of prisoners that escape when the prison has n cells.
Sample Input
2
5
100
Sample Output
2
10

题意:
解题:标记 判断次数是奇数偶数即可。

#include <iostream>
#include<cstdio>
#include<string.h>
using namespace std;
int main()
{
   
    int t;
    int a;
    int s[150];
    cin>>t;
    while(t--)
    {
   
        cin>>a;
        int yy=0;
        memset(s,0,sizeof(s));
        for(int i=1; i<=a; i++)//出现是次数
        {
   
            for(int j=i; j<=a; j+=i)
            {
   
                s[j]++;
            }
        }
        int ans=0;
        for(int i=1; i<=a; i++)
        {
   
            //cout<<s[i]<<endl;
            if(s[i]%2==1)//奇数次为开
                ans++;
        }
        cout<<ans<<endl;
    }
    return 0;
}