这个题我是过不去了。。
//============================================================================
// Name : pat.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int number;
int power;
int main() {
bool first=true;
while(cin>>number&&cin>>power)
{
if(number!=0&&power!=0)
{
if(first)
{
first=false;
}
else
{
cout<<" ";
}
cout<<number*power<<" "<<power-1;
}
else if(power==0)
{
continue;
} else
{
if(first)
{
first=false;
}
else
{
cout<<" ";
}
cout<<"0 0";
}
}
}
PAT算法题解析
本文提供了一个PAT算法题目的实现思路及代码示例。通过C++程序解析了输入两个整数并进行特定运算的问题,展示了如何根据不同的输入条件输出相应的结果。
913

被折叠的 条评论
为什么被折叠?



