ABC337(A-C)

A

#include
using namespace std;
int main()
{
  int n;
  cin>>n;
  int suma=0;
  int sumb=0;
  int a,b;
  while(n--){
    cin>>a>>b;
    suma+=a;
    sumb+=b;
  }
  if(suma>sumb)cout<<"Takahashi"<

B

#include
using namespace std;
int main()
{
  string s;
  cin>>s;
  string s0=s;
  for(auto i:s){
    if(i!='A'&&i!='B'&&i!='C'){
        cout<<"No"<

C

#include
using namespace std;
struct people{
    int id;
    int num;
};
bool cmp(people a,people b){
    return a.num>1);     
      if(key < a[mid].num)           
          high = mid-1;            
      else if(key > a[mid].num)     
          low = mid+1;            
      else                         
          return mid;
        }
    return -1;              
}

int main()
{
    int n;
    cin>>n;
    people a[n];
    int key;
    for(int i=0;i>a[i].num;
        if(a[i].num==-1)key=a[i].id;
    }
    cout<

你可能感兴趣的:(c语言,c++,算法)