Codeforces Round #149 (Div. 2) A. Heads or Tails

题目:http://codeforces.com/contest/242/problem/A

抛硬币 输出各种满足条件的结果

#include <iostream>

using namespace std;

int arr[10000][2];

int main()
{
    int x,y,a,b;
    cin>>x>>y>>a>>b;
    int n=0;
    for(int i=a;i<=x;i++)
    {
        for(int j=b;j<=y;j++)
        {
            if(i>j) 
            {
                arr[n][0]=i;
                arr[n][1]=j;
                n++;
            }
        }
    }
    cout<<n<<endl;
    for(int i=0;i<n;i++)
    {
        cout << arr[i][0]<<" "<<arr[i][1]<<endl;
    }

    return 0;
}

 

转载于:https://www.cnblogs.com/danielqiu/archive/2013/01/20/2868358.html

评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符 “速评一下”
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
https://edu.csdn.net/lesson/detail/1?utm_source=eduxy_studylx_t00_ai