mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
d
This commit is contained in:
BIN
XSM OJ 重庆小码王集团OJ/.DS_Store
vendored
Normal file
BIN
XSM OJ 重庆小码王集团OJ/.DS_Store
vendored
Normal file
Binary file not shown.
16
XSM OJ 重庆小码王集团OJ/【字符串】石头剪子布.cpp
Normal file
16
XSM OJ 重庆小码王集团OJ/【字符串】石头剪子布.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
signed main()
|
||||
{
|
||||
int n;
|
||||
cin >> n ;
|
||||
for(int i = 1; i <= n; ++ i)
|
||||
{
|
||||
string s1, s2;
|
||||
cin >> s1 >> s2 ;
|
||||
if(s1 == "Rock" && s2 == "Scissors" || s1 == "Scissors" && s2 == "Paper" || s1 == "Paper" && s2 == "Rock") cout << "Player1" << endl ;
|
||||
else if(s1 == s2) cout << "Tie" << endl ;
|
||||
else cout << "Player2" << endl ;
|
||||
}
|
||||
}
|
21
XSM OJ 重庆小码王集团OJ/希蒙的AC贴纸数.cpp
Normal file
21
XSM OJ 重庆小码王集团OJ/希蒙的AC贴纸数.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#define int long long
|
||||
using namespace std;
|
||||
|
||||
signed main()
|
||||
{
|
||||
char a[1005];
|
||||
scanf("%[^\n]", &a);
|
||||
int i = 0, cnt = 0;
|
||||
while(a[i] != '\0')
|
||||
{
|
||||
if(((a[i] == 'A' && a[i + 1] == 'C') || a[i] == a[i + 1]) && a[i] != ' ')
|
||||
{
|
||||
cnt ++ ;
|
||||
}
|
||||
i ++ ;
|
||||
}
|
||||
cout << cnt ;
|
||||
return 0;
|
||||
}
|
15
XSM OJ 重庆小码王集团OJ/开关灯.cpp
Normal file
15
XSM OJ 重庆小码王集团OJ/开关灯.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int n;
|
||||
cin >> n ;
|
||||
if(n % 2 == 1)
|
||||
{
|
||||
cout << 1 ;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << 0 ;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,12 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
int main(){
|
||||
int n;
|
||||
cin >> n;
|
||||
cout <<n<<n<<n<<" "<<n<<n<<n<<" "<<n<<n<<n<<" "<<n<<n<<n<<endl;
|
||||
cout <<" "<<n<<" "<<n<<" "<<n<<" "<<" "<<n<<" "<<n<<" "<<n<<endl;
|
||||
cout <<n<<n<<n<<" "<<n<<" "<<n<<" "<<n<<n<<n<<" "<<n<<" "<<n<<endl;
|
||||
cout <<n<<" "<<" "<<n<<" "<<n<<" "<<n<<" "<<" "<<n<<" "<<n<<endl;
|
||||
cout <<n<<n<<n<<" "<<n<<n<<n<<" "<<n<<n<<n<<" "<<n<<n<<n<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int N;
|
||||
cin >> N;
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i <= N; ++i) {
|
||||
for (int j = 0; j <= N; ++j) {
|
||||
for (int k = 0; k <= N; ++k) {
|
||||
if (i != j && j != k && i != k && (i * 100 + j * 10 + k) % 2 != 0 && i != 0) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cout << count << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
10
XSM OJ 重庆小码王集团OJ/求阴影面积.cpp
Normal file
10
XSM OJ 重庆小码王集团OJ/求阴影面积.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
double a;
|
||||
cin >> a ;
|
||||
printf("%.2lf", a * a / 4);
|
||||
return 0;
|
||||
}
|
67
XSM OJ 重庆小码王集团OJ/算天数.cpp
Normal file
67
XSM OJ 重庆小码王集团OJ/算天数.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
|
||||
bool isLeapYear(int year) {
|
||||
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0 && year % 3200 != 0)){
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int getDaysOfMonth(int year, int month) {
|
||||
if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12){
|
||||
return 31;
|
||||
}
|
||||
if(month == 4 || month == 6 || month == 9 || month == 11){
|
||||
return 30;
|
||||
}
|
||||
if(month == 2){
|
||||
if(isLeapYear(year)==1){
|
||||
return 29;
|
||||
}else{
|
||||
return 28;
|
||||
}
|
||||
}
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ӹ<EFBFBD>Ԫ2021<32><31>1<EFBFBD><31>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>
|
||||
int calcDays(int year, int month, int day) {
|
||||
int days = 0;
|
||||
for (int i = 2021; i < year; i++) {
|
||||
if(isLeapYear(i)==1){
|
||||
days +=366;
|
||||
}else{
|
||||
days +=365;
|
||||
}
|
||||
}
|
||||
for (int i = 1; i < month; i++) {
|
||||
days += getDaysOfMonth(year, i);
|
||||
}
|
||||
days += day-1;
|
||||
return days;
|
||||
}
|
||||
|
||||
int calcWeekday(int days) {
|
||||
days+=5;
|
||||
days%=7;
|
||||
if(days==0){
|
||||
return 7;
|
||||
}
|
||||
return days;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int year, month, day;
|
||||
cin >> year >> month >> day;
|
||||
|
||||
int days = calcDays(year, month, day);
|
||||
int weekday = calcWeekday(days);
|
||||
|
||||
cout << days << endl;
|
||||
cout << '*' << weekday << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user