【无标题】


#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;
} 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值