关于杭电2029题Identity Card不能AC的疑惑

关于杭电2029题Identity Card不能AC的疑惑


题目地址:http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1&sectionid=2&problemid=25

以下是我的代码:

#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,i;
	string s,place;
	cin>>n;
	for(i=0;i<n;i++)
	   {
	      cin>>s;
		  int sp;
		  sp=stoi(s.substr(0,2));
	      switch(sp){
	      	case 33:
	      		 place="Zhejiang";
	      		 break;
	        case 11:
	        	 place="Beijing";
	        	 break;
	        case 71:
	        	 place="*";
	        	 break;
	        case 81:
	        	place="*";
	        	break;
	        case 82:
	        	place="Macao";
	        	break;
	        case 54:
	        	place="Tibet";
	        	break;
	        case 21:
	        	place="Liaoning";
	        	break;
	        case 31:
	        	place="Shanghai";
	        	 break;
	        default:
	        	return 0;
				 }
			int year=stoi(s.substr(6,4));
			int month=stoi(s.substr(10,2));
			int day=stoi(s.substr(12,2));
			cout<<"He/She is from "<<place<<",and his/her birthday is on "<<month<<","<<day<<","<<year<<" based on the table."<<endl;
		  }
		  return 0;
	  }

本地运行是对的,可是提交时一直是Wrong Answer.希望有大佬能够解答.

上一篇:Identity Server 4 原理和实战(完结)_建立Identity Server 4项目,Client Credentials 授权实例


下一篇:企业级工作流解决方案(六)--微服务消息处理模型之与Abp集成