嗨嗨嗨,好久没写了,来更吧
(题解)
上代码!
可达P0429 鸡兔同笼2
#include<bits/stdc++.h>
using namespace std;
int main(){
int x, y, a = 0, b = 0;
cin >> x >> y;
b = (y - 2 * x) / 2;
a = x - b;
cout << a <<" "<< b;
return 0;
}
可达 P0561 金字塔
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
while(cin >> n){
for(int i=1;i<=n;i++){
for(int j=1;j<=n-i;j++)cout<<" ";
for(int j=1;j<=i*2-1;j++)cout<<"*";
cout<<endl;
}
}
while(cin >> m){
for(int i=1;i<=m;i++){
for(int j=1;j<=m-i;j++)cout<<" ";
for(int j=1;j<=i*2-1;j++)cout<<"*&#