#include<iostream>
using namespace std;
int main()
{
int n,d;
enum {sun,mon,tue,wed,thu,fri,sat}day;
char weekday[7][4]={"sun","mon","tue","wed","thu","fri","sat"};
printf("input today=");
cin>>d;
switch(d%7)
{
case 0:day=sun;
case 1:day=mon;
case 2:day=tue;
case 3:day=wed;
case 4:day=thu;
case 5:day=fri;
case 6:day=sat;
}
printf("input number=");
cin>>n;
cout<<weekday[(d+n)%7];
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int num = 12345;
int arr[10] = {0};
int i = 0;
while (num) {
arr[i++] = num % 10;
num /= 10;
}
for (int j = 0; j < i; j++) {
printf("%d ", arr[j]);
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
int n, a[10];
int index = 0;
char eng[10][6] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
cout << "Input a positive integer: ";
cin >> n;
while(n)
{
a[index] = n%10;
index++;
n /= 10;
}
cout << "Eng_exp: " << eng[a[index-1]];
for(int i=index-2; i>=0; i--)
{
cout << "-" << eng[a[i]];
}
cout << endl;
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
void mp(int a[],int n)
{
int temp;
for (int i = 0; i < n-1;i++) {
for (int j = 0; j <n-i-1;j++) {
if (a[j] >=a[j + 1]) {
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
}
int main()
{
int n;
int arr[100];
cin>>n;
for (int i = 0; i < n;i++) {
cin>>arr[i];
}
mp(arr,n);
for (int i = 0; i < n;i++) {
cout<<arr[i];
}
return 0;
}
#include<iostream>
#include<cstring>
using namespace std;
void yj(int *n,int *m)
{
int big=((*n>*m)?(*n):(*m));
for(int i=big;i>=1;i--){
if(*n%i==0&&*m%i==0){
*n/=i; //分子(前项)
*m/=i; //分母(后项)
}
}
cout<<*n<<*m;
}
int main()
{
int n,m;
cin>>n>>m;
yj(&n,&m);
return 0;
}