算法提高新建MicrosoftWord文档
本文最后更新于 1831 天前,其中的信息可能已经有所发展或是发生改变。
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int main(){
	int arr[2100];
	int n;
	cin>>n;
	memset(arr,0,sizeof(arr));
	for(int i=0;i<n;i++){
		string str;
		cin>>str;
		if(!str.compare("New")){
			int j=1;
			while(true){
				if(arr[j]==0){
					arr[j]=1;
					cout<<j<<endl;
					break;
				}
				j++;
			}
		}else{
			int temp;
			cin>>temp;
			if(arr[temp]==1){
				arr[temp]=0;
				cout<<"Successful"<<endl;
			}else{
				cout<<"Failed"<<endl;
			}
		}
	}
	return 0;
} 
作者:Yuyy
博客:https://yuyy.info
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇