当前位置: 首页 > article >正文

P8722 [蓝桥杯 2020 省 AB3] 日期识别

P8722 [蓝桥杯 2020 省 AB3] 日期识别

  • 链接
  • 题目
  • 代码

链接

添加链接描述

题目

在这里插入图片描述

代码

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <queue>
#include <climits>  // 包含INT_MAX常量
#include <cctype>
using namespace std;


string a[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};

int main() {
	string s;
	cin >> s;
	int result = 0;
	string month = s.substr(0, 3);
	for (int i = 0; i < 12; i++) {
		if (month == a[i]) {
			result = i + 1;
			break;
		}

	}
	string day = s.substr(3, 5);
	cout << result << ' ';
	if (day[0] != '0')
		cout << day[0];
	cout << day[1];
	return 0;
}

http://www.kler.cn/a/553992.html

相关文章:

  • 挪车小程序挪车二维码php+uniapp
  • SQLMesh 系列教程5- 详解SQL模型
  • N93-第六周作业
  • 什么叫不可变数据结构?
  • ubuntu上/etc/profile.d/目录的作用
  • JAVA中常用类型
  • linux下pip下载项目失败
  • 【Java】自定义注解、元注解
  • Huggingface简介和基础使用指南(抱脸)(NLP公司、Transformers库、Huggingface Hub)
  • 华为S系列交换机安全加固解决方案
  • Python----Python高级(网络编程:网络高级:多播和广播,C/S架构,TCP,UDP,网络编程)
  • 【数据库】PyMySQL详解:轻松实现Python与MySQL的高效交互
  • 值传递与引用传递:Java 中的不同方式
  • 所有文件转markdown文件
  • 在 WSL上的 Ubuntu 中通过 Docker 来运行 Redis,并在微服务项目中使用redis
  • Docker:3、在VSCode上安装并运行python程序或JavaScript程序
  • deepseek本地调用
  • 解决Failed to resolve import “@element-plus/icons-vue“ from.... vue3使用icons报错问题
  • goland无法debug项目
  • 汉化VScode