1100 Mars Numbers

#include<iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
int getnum(string temp){
	int ans=0;
	for(int i=0;i<temp.size();i++){
		ans=ans+(temp[i]-'0')*pow(10,temp.size()-i-1);
	}
	return ans;
}
string hash1[13]={"tret","jan","feb","mar","apr","may","jun","jly","aug","sep","oct","nov","dec"};
string hash2[12]={"tam","hel","maa","huh","tou","kes","hei","elo","syy","lok","mer","jou"};
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("in.txt","r",stdin);
	#endif 
	int n;
	cin>>n;
	getchar();
	for(int i=0;i<n;i++){
		string temp;
		getline(cin,temp);
		if(temp.size()==4) cout<<0<<endl;
		else if(temp.size()>4){
			string temp1,temp2;
			temp1=temp.substr(0,3);
			temp2=temp.substr(4,3);
			int ans=0;
			for(int i=0;i<12;i++){
				if(hash2[i]==temp1){
					ans=ans+(i+1)*13;break;
				}
			}
			for(int i=1;i<13;i++){
				if(hash1[i]==temp2){
					ans=ans+i;break;
				}
			}
			cout<<ans<<endl;
		}else if(temp.size()<4){
			if(temp[0]<='9'&&temp[0]>='0'){
				int t=getnum(temp);
				if(t<=12){
					cout<<hash1[t]<<endl;
				}else if(t>12&&t<169){
					if(t%13!=0)
					cout<<hash2[t/13-1]<<' '<<hash1[t%13]<<endl;
					else cout<<hash2[t/13-1]<<endl;
				}
			}else if(temp[0]>='a'&&temp[0]<='z'){
				for(int i=0;i<13;i++){
					if(hash1[i]==temp){
						cout<<i<<endl;break;
					}
				}
				for(int i=0;i<12;i++){
					if(hash2[i]==temp){
						cout<<(i+1)*13<<endl;break; 
					}
				}
			}
		}
	}
	return 0;
}
 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Mars是一个由微信开发的跨平台网络组件。要在Windows上使用Mars,你需要按照以下步骤进行操作: 1. 首先,打开Visual Studio 2017,并导航到C:/temp/mars-1.3.0/mars/samples/Windows目录下找到sample.sln解决方案文件。你可以通过双击该文件来打开解决方案。 2. 在解决方案中,你可以找到Mars的示例代码和项目文件。你可以根据你的需求进行修改和编译。 3. 如果你想使用Xlog加密功能,你可以参考Tencent/mars的官方文档中的Xlog加密使用指引。你可以在GitHub上的Tencent/mars Wiki页面找到这个指引。 4. 另外,如果你在安装Python扩展模块时遇到了"Unable to find vcvarsall.bat"的问题,你可以参考云游道士的博客文章中对这个问题的解决方案。他提供了关于这个问题的描述、问题分析和总结。 总的来说,要在Windows上使用Mars,你需要使用Visual Studio 2017打开Mars的解决方案文件,根据需要进行修改和编译,并可以参考相关文档来了解特定功能的使用方法。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [腾讯mars,在windows上编译](https://blog.csdn.net/harborian/article/details/90596898)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [windows11 mars xlog解密环境配置](https://blog.csdn.net/c_m_deng/article/details/125428740)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值