标签:amp namespace main use image == input isp print
2 14 32 10 16
12 2 No answer
#include <iostream>
#include <stdio.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv)
{
int n,m;
int a;
int count=0;
scanf("%d",&a);
for(int i=0;i<a;i++)
{
scanf("%d",&n);
scanf("%d",&m);
for(int x=0;x<n;x++)
{
if(2*x+4*(n-x)==m)
{
count=1;
printf("%d ",x);
printf("%d ",n-x);
}
}
if(count==0)
{
printf("No answer");
}
count=0;
printf("\n");
}
return 0;
}
标签:amp namespace main use image == input isp print
原文地址:http://www.cnblogs.com/panlangen/p/7719662.html