题解 | #判断季节#

判断季节

http://www.nowcoder.com/practice/741a9b79fabe474cb153a49b4bff5828

###这里面一个汉字竟然占3个字节,害得我搞了半天,气死我了

include #include using namespace std;

int main() {

int month;
cin >> month;
string chin="春夏秋冬";

if((month-1)/12!=0 || month<1){

// cout <<"*** 案例 滚蛋" << endl; cout <<"不合法" << endl; return 0; }

month/=3;
month+=7;
month%=4;

cout << chin[month*3] << chin[month*3+1] << chin[month*3+2] << "季" << endl; 

// write your code here......
return 0;

}

全部评论

相关推荐

迷茫的大四🐶:只有花了钱才能吃一堑长一智
点赞 评论 收藏
分享
05-19 19:54
已编辑
杭州电子科技大学 Java
程序员小白条:《备考软考软件设计师》中级很简单的,不需要花很多时间,除非考软高,这简历找找杭州本地中小厂吧,也很难,项目这块还是最好有自己开发的思考,不要网上的亮点搬过来就行,看运气,本地有优势
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务