delete pics to save space
This commit is contained in:
12
history_source/ccf 入门篇/U3/3.1.1(1).cpp
Normal file
12
history_source/ccf 入门篇/U3/3.1.1(1).cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a,b;
|
||||
cout<<"a,b=";
|
||||
cin>>a>>b;
|
||||
if(a=b)cout<<a;
|
||||
else cout<<"Unequal";
|
||||
while(true);
|
||||
}
|
12
history_source/ccf 入门篇/U3/3.1.1(2).cpp
Normal file
12
history_source/ccf 入门篇/U3/3.1.1(2).cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a,b;
|
||||
cout<<"a,b=";
|
||||
cin>>a>>b;
|
||||
if(a==b)cout<<a;
|
||||
else cout<<"Unequal";
|
||||
while(true);
|
||||
}
|
16
history_source/ccf 入门篇/U3/3.1.2(1).cpp
Normal file
16
history_source/ccf 入门篇/U3/3.1.2(1).cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a,b,c=0,d=0;
|
||||
cout<<"a,b=";
|
||||
cin>>a>>b;
|
||||
if(a>b)
|
||||
{
|
||||
c=a/b;
|
||||
d=a%b;
|
||||
}
|
||||
cout<<c+d;
|
||||
while(true);
|
||||
}
|
14
history_source/ccf 入门篇/U3/3.1.2(2).cpp
Normal file
14
history_source/ccf 入门篇/U3/3.1.2(2).cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a,b,c=0,d=0;
|
||||
cout<<"a,b=";
|
||||
cin>>a>>b;
|
||||
if(a>b)
|
||||
c=a/b;
|
||||
d=a%b;
|
||||
cout<<c+d;
|
||||
while(true);
|
||||
}
|
16
history_source/ccf 入门篇/U3/3.1.3.cpp
Normal file
16
history_source/ccf 入门篇/U3/3.1.3.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int n,a,b,c,m;
|
||||
while(true){
|
||||
cin>>n;
|
||||
a=n/100;
|
||||
b=n/10-a*10;
|
||||
c=n-a*100-b*10;
|
||||
m=a*a*a+b*b*b+c*c*c;
|
||||
if(n==m)cout<<"Yes"<<endl;
|
||||
else cout<<"No"<<endl;
|
||||
}
|
||||
}
|
17
history_source/ccf 入门篇/U3/3.2.1.cpp
Normal file
17
history_source/ccf 入门篇/U3/3.2.1.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int b,g;
|
||||
while(true)
|
||||
{
|
||||
cin>>b>>g;
|
||||
if((b+g)<10) cout<<"water"<<endl;
|
||||
else{
|
||||
if(b>g) cout<<"tree"<<endl;
|
||||
else cout<<"tea"<<endl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
18
history_source/ccf 入门篇/U3/3.2.2.cpp
Normal file
18
history_source/ccf 入门篇/U3/3.2.2.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int g;
|
||||
while(true)
|
||||
{
|
||||
cin>>g;
|
||||
if(!(g>30))
|
||||
{
|
||||
if(g<=10) cout<<"<EFBFBD><EFBFBD>Ҫ "<<0.8*g<<"Ԫ"<<endl;
|
||||
if(g>10&&g<=20) cout<<"<EFBFBD><EFBFBD>Ҫ "<<0.75*g<<"Ԫ"<<endl;
|
||||
if(g>20&&g<=30) cout<<"<EFBFBD><EFBFBD>Ҫ "<<0.7*g<<"Ԫ"<<endl;
|
||||
}
|
||||
else cout<<"<EFBFBD><EFBFBD><EFBFBD>ʼģ<EFBFBD>"<<endl;
|
||||
}
|
||||
}
|
15
history_source/ccf 入门篇/U3/3.2.3.cpp
Normal file
15
history_source/ccf 入门篇/U3/3.2.3.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int x,y;
|
||||
while(true)
|
||||
{
|
||||
cin>>x>>y;
|
||||
x=abs(x);
|
||||
y=abs(y);
|
||||
if(x<=1&&y<=1) cout<<"Yes"<<endl;
|
||||
else cout<<"No"<<endl;
|
||||
}
|
||||
}
|
20
history_source/ccf 入门篇/U3/3.2.4.cpp
Normal file
20
history_source/ccf 入门篇/U3/3.2.4.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
while(true)
|
||||
{
|
||||
cin>>a;
|
||||
if((a%123>=97)&&(a%123<=122)) cout<<char(a%123)<<endl;
|
||||
else
|
||||
{
|
||||
if((a%91>=65)&&(a%91<=90)) cout<<char(a%91)<<endl;
|
||||
else
|
||||
{
|
||||
cout<<"*"<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
11
history_source/ccf 入门篇/U3/3.3.1.cpp
Normal file
11
history_source/ccf 入门篇/U3/3.3.1.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
cout<<"A:"<<endl;
|
||||
cout<<"B:x=2"<<endl;
|
||||
cout<<"C:z =7"<<endl;
|
||||
cout<<"D:x=2"<<endl;
|
||||
cout<<"E:z =6";
|
||||
while(true);
|
||||
}
|
21
history_source/ccf 入门篇/U3/3.3.2.cpp
Normal file
21
history_source/ccf 入门篇/U3/3.3.2.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
float a,b,c;
|
||||
while(true)
|
||||
{
|
||||
cin>>a>>b>>c;
|
||||
if(!((a+b>c)&&(a+c>b)&&(b+c>a))) cout<<"No!"<<endl;
|
||||
else
|
||||
{
|
||||
if(a==b&&a==c) cout<<"<EFBFBD>ȱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
else
|
||||
{
|
||||
if((a*a+b*b==c*c)||(a*a+c*c==b*b)||(b*b+c*c==a*a)) cout<<"ֱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
else cout<<"һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
21
history_source/ccf 入门篇/U3/3.3.3.cpp
Normal file
21
history_source/ccf 入门篇/U3/3.3.3.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int f;
|
||||
while(true)
|
||||
{
|
||||
cin>>f;
|
||||
if(f>90) cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
else
|
||||
{
|
||||
if(f/10==8) cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
else
|
||||
{
|
||||
if(f>=60&&f<80) cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
else cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6
history_source/ccf 入门篇/U3/3.4.1.cpp
Normal file
6
history_source/ccf 入门篇/U3/3.4.1.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
|
||||
}
|
22
history_source/ccf 入门篇/U3/3.4.2.cpp
Normal file
22
history_source/ccf 入门篇/U3/3.4.2.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
while(true)
|
||||
{
|
||||
cin>>a;
|
||||
switch(a)
|
||||
{
|
||||
case 1:cout<<"Monday"<<endl;break;
|
||||
case 2:cout<<"Tuesday"<<endl;break;
|
||||
case 3:cout<<"Wednesday"<<endl;break;
|
||||
case 4:cout<<"Thursday"<<endl;break;
|
||||
case 5:cout<<"Friday"<<endl;break;
|
||||
case 6:cout<<"Saturday"<<endl;break;
|
||||
case 7:cout<<"Sunday"<<endl;break;
|
||||
default:cout<<"Sorry!"<<endl;
|
||||
}
|
||||
}
|
||||
}
|
40
history_source/ccf 入门篇/U3/3.4.3.cpp
Normal file
40
history_source/ccf 入门篇/U3/3.4.3.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include<iostream>
|
||||
#include<cmath>
|
||||
using namespace std;
|
||||
int y,m;
|
||||
bool p()
|
||||
{
|
||||
if(y%400==0) return 1;
|
||||
if(y%100==0) return 0;
|
||||
if(y%4==0) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
while(true)
|
||||
{
|
||||
cin>>y>>m;
|
||||
switch(m)
|
||||
{
|
||||
case 1:cout<<"31days"<<endl;break;
|
||||
case 2:{
|
||||
if(p())cout<<"29days"<<endl;
|
||||
else cout<<"28days"<<endl;
|
||||
break;
|
||||
}
|
||||
case 3:cout<<"31days"<<endl;break;
|
||||
case 4:cout<<"30days"<<endl;break;
|
||||
case 5:cout<<"31days"<<endl;break;
|
||||
case 6:cout<<"30days"<<endl;break;
|
||||
case 7:cout<<"31days"<<endl;break;
|
||||
case 8:cout<<"31days"<<endl;break;
|
||||
case 9:cout<<"30days"<<endl;break;
|
||||
case 10:cout<<"31days"<<endl;break;
|
||||
case 11:cout<<"30days"<<endl;break;
|
||||
case 12:cout<<"31days"<<endl;break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
22
history_source/ccf 入门篇/U3/3.4.4.cpp
Normal file
22
history_source/ccf 入门篇/U3/3.4.4.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a;
|
||||
while(true)
|
||||
{
|
||||
cout<<"[1]apples"<<endl<<"[2]pears"<<endl<<"[3]oranges"<<endl<<"[4]grapes"<<endl<<"[0]Exit"<<endl;
|
||||
cin>>a;
|
||||
cout<<"price= ";
|
||||
switch(a)
|
||||
{
|
||||
case 1:cout<<3.0;break;
|
||||
case 2:cout<<2.5;break;
|
||||
case 3:cout<<4.2;break;
|
||||
case 4:cout<<10.2;break;
|
||||
case 0:return 0;
|
||||
default:cout<<0;
|
||||
}
|
||||
cout<<endl<<endl;
|
||||
}
|
||||
}
|
12
history_source/ccf 入门篇/U3/3.5.1.cpp
Normal file
12
history_source/ccf 入门篇/U3/3.5.1.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
long double x;
|
||||
while(true)
|
||||
{
|
||||
cin>>x;
|
||||
if(x=0.5) cout<<"0.5 min"<<endl;
|
||||
else cout<<(x-0.5)/0.2+3<<" min"<<endl;
|
||||
}
|
||||
}
|
20
history_source/ccf 入门篇/U3/3.5.2.cpp
Normal file
20
history_source/ccf 入门篇/U3/3.5.2.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
long double a;
|
||||
while(true)
|
||||
{
|
||||
cin>>a;
|
||||
if(a>=0&&a<5) cout<<a+2.5<<endl;
|
||||
else
|
||||
{
|
||||
if(a>=5&&a<10) cout<<2-1.5*(a-3)*(a-3)<<endl;
|
||||
else
|
||||
{
|
||||
if(a>=10&&a<20) cout<<a/2-1.5<<endl;
|
||||
else cout<<"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч!"<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
24
history_source/ccf 入门篇/U3/3.5.3.cpp
Normal file
24
history_source/ccf 入门篇/U3/3.5.3.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
string a;
|
||||
while(true)
|
||||
{
|
||||
cin>>a;
|
||||
cout<<a<<"<EFBFBD><EFBFBD>"<<a.size()<<"λ<EFBFBD><EFBFBD>"<<endl;
|
||||
for(int i=0;i<a.size();i++)
|
||||
{
|
||||
switch(i+1)
|
||||
{
|
||||
case 1:cout<<"<EFBFBD><EFBFBD>λ ";break;
|
||||
case 2:cout<<"ʮλ ";break;
|
||||
case 3:cout<<"<EFBFBD><EFBFBD>λ ";break;
|
||||
case 4:cout<<"ǧλ ";break;
|
||||
}
|
||||
cout<<a[a.size()-i-1]<<endl;
|
||||
}
|
||||
cout<<endl;
|
||||
}
|
||||
}
|
16
history_source/ccf 入门篇/U3/3.5.4.cpp
Normal file
16
history_source/ccf 入门篇/U3/3.5.4.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
double i;
|
||||
while(true)
|
||||
{
|
||||
cin>>i;
|
||||
if(i<=10){ cout<<((int) i*0.1/1000)*1000;continue; }
|
||||
if(i>10&&i<20){ cout<<((int) (10*0.1+(i-10)*0.75)/1000)*1000;continue; }
|
||||
if(i>=20&&i<40){ cout<<((int) (10*0.1+10*0.075+(i-20)*0.05)/1000)*1000;continue; }
|
||||
if(i>=40&&i<60){ cout<<((int) (10*0.1+10*0.075+20*0.05+(i-40)*0.03)/1000)*1000;continue; }
|
||||
if(i>=60&&i<100){ cout<<((int) (10*0.1+10*0.075+20*0.05+20*0.03+(i-60)*0.015)/1000)*1000;continue; }
|
||||
if(i>100){ cout<<((int) (10*0.1+10*0.075+20*0.05+20*0.03+40*0.015+(i-100)*0.01)/1000)*1000;continue; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user