P1000-1003
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}
#include <iostream>
using
namespace
std;
int
main()
{
int
a[10];
int
sum=0;
for
(
int
i=0;i<10;i++)
{
cin>>a[i];
}
int
height;
cin>>height;
for
(
int
i=0;i<10;i++)
{
if
(a[i]<=height+30)
{
sum++;
}
}
cout<<sum<<endl;
return
0;
}
#include<iostream>
using
namespace
std;
int
main()
{
int
a,b;
int
time
;
int
angrist=0;
int
day;
for
(
int
i=1;i<=7;i++)
{
cin>>a>>b;
time
=a+b;
if
((
time
>8)&&(
time
>angrist))
{
angrist=
time
;day=i;
}
}
cout<<day<<endl;
return
0;
}
#include<iostream>
using namespace std;
int main()
{
int money=0;
int plan;
int mom;
int flag=1;
for(int i=1;i<=12;i++)
{
cin>>plan;
money+=300;
money-=plan;
mom+=money/100;
if(money<0)
{
cout<<-i<<endl;
flag=0;
break;
}
money%=100;
}
if(flag==1)
{
money+=mom*120;
cout<<money<<endl;
}
return 0;//这个不能忘
}
using namespace std;
int main()
{
int money=0;
int plan;
int mom;
int flag=1;
for(int i=1;i<=12;i++)
{
cin>>plan;
money+=300;
money-=plan;
mom+=money/100;
if(money<0)
{
cout<<-i<<endl;
flag=0;
break;
}
money%=100;
}
if(flag==1)
{
money+=mom*120;
cout<<money<<endl;
}
return 0;//这个不能忘
}