日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Codeforces Gym 100286I iSharp 水题

發布時間:2024/9/20 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Codeforces Gym 100286I iSharp 水题 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Problem I. iSharp
Time Limit: 20 Sec

Memory Limit: 256 MB

題目連接

http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86821#problem/I

Description

You are developing a new fashionable language that is not quite unlike C, C++, and Java. Since your language should become an object of art and fashion, you call it i # (spelled i-sharp). This name combines all the modern naming trends and also hints at how smart you are. Your language caters for a wide auditory of programmers and its type system includes arrays (denoted with “[]”), references (denoted with “&”), and pointers (denoted with “*”). Those type constructors can be freely combined in any order, so that a pointer to an array of references of references of integers (denoted with “int&&[]*”) is a valid type. Multiple variables in i # can be declared on a single line with a very convenient syntax where common type of variables is given first, followed by a list of variables, each optionally followed by additional variable-specific type constructors. For example, the following line: int& a*[]&, b, c*; declares variables a, b, and c with types “int&&[]*”, “int&”, and “int&*” correspondingly. Note, that type constructors on the right-hand sides of variables in i # bind to variable and their order is reversed when they are moved to the left-hand side next to type. Thus “int*& a” is equivalent to “int a&*”. However, you discover that coding style with multiple variable declarations per line is confusing and is outlawed in many corporate coding standards. You decide to get rid of it and refactor all existing i # code to a single variable declaration per line and always specify type constructor next to the type it refers to (instead of the right-hand side of variable). Your task it to write such refactoring too

Input

The input file contains a single line with a declaration of multiple variables in i #. The line starts with a type name, followed by zero, one, or more type constructors, followed by a space, followed by one or more variable descriptors separated by “,” (comma) and space, and terminated by “;” (semicolon). Each variable descriptor contains variable name, followed by zero, one, or more type constructors. Type name and variable names are distinct and consist of lowercase and uppercase English letters from “a” to “z” or “A” to “Z”. The line contains at most 120 characters and does not contain any extra spaces.

Output

Write to the output file a line for each variable declared in the input file. For each variable write its declaration on a single line in the same format as in the input file, but with all type constructors next to its type. Separate type with all type constructors from a variable name by a single space. Do not write any extra spaces.

Sample Input

int& a*[]&, b, c*;?

Sample Output

int&&[]* a;
int& b;
int&* c;

HINT

?

題意

#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <cmath> #include <vector> #include <stack> #include <map> #include <set> #include <queue> #include <iomanip> #include <string> #include <ctime> #include <list> typedef unsigned char byte; #define pb push_back #define input_fast std::ios::sync_with_stdio(false);std::cin.tie(0) #define local freopen("in.txt","r",stdin) #define pi acos(-1)using namespace std; string str; string sb; string temp; string name; string sign; int a1 = 0 , a2 = 0 , a3 = 0;void GetName() {name.clear();sign.clear();for(int i = 0 ; i < temp.size() ; ++ i){if ( (temp[i] <= 'Z' && temp[i] >= 'A' ) || (temp[i] <= 'z' && temp[i] >= 'a') ){name.pb(temp[i]);}elsesign.pb(temp[i]);}reverse(sign.begin(),sign.end());for(int i = 0 ; i < sign.size() ; ++ i){if (sign[i] == '[') sign[i] = ']';else if(sign[i] == ']') sign[i] = '[';} }int main(int argc,char *argv[]) {freopen("isharp.in","r",stdin);freopen("isharp.out","w",stdout);getline(cin,str);int bg;for(int i = 0 ; i< str.size() ; ++ i){if (str[i] == ' '){sb = str.substr(0,i);bg = i;break;}}int pre = bg;for(int i = bg ; i < str.size() ; ++ i){if (str[i] == ',' || str[i] == ';'){temp.clear();temp = str.substr(pre+1,i-pre-1);GetName();cout << sb << sign << " "<< name << ';'<<endl;i ++;pre = i;}}return 0; }

?

題,然后倒著輸出字符就好了

題解

模擬一下就好了

代碼:

總結

以上是生活随笔為你收集整理的Codeforces Gym 100286I iSharp 水题的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 成人a视频在线观看 | 久久久久久69 | 少妇饥渴难耐 | 亚洲中文字幕无码一区二区三区 | 午夜影院试看 | 伦理自拍 | 中文写幕一区二区三区免费观成熟 | 成人性生活免费视频 | av电影在线播放 | 黄色网免费 | 高清av网址 | 精品国产视频一区二区三区 | 麻豆精品视频在线 | 777久久久精品一区二区三区 | 高清一区二区三区 | 国产免费91视频 | 好吊在线视频 | 毛片网站免费在线观看 | 男女av在线 | 国产在线视频网址 | 91精品国产一区二区三区蜜臀 | 国产三级成人 | 爱情岛论坛亚洲线路一 | 免费荫蒂添的好舒服视频 | 国产精品三级 | 91xxxxx| 夜夜天天操| 亚洲天堂小说 | 亚洲天堂社区 | 欧美日韩一区视频 | 无码专区久久综合久中文字幕 | 狠狠干香蕉 | 一区二区片 | 亚洲精品第一 | 强制憋尿play黄文尿奴 | 动漫av在线免费观看 | 成人午夜免费福利视频 | h片在线观看视频 | 亚洲精品免费在线观看 | 久久久精品人妻一区二区三区四 | 激情欧美在线 | 亚洲精品www久久久久久 | 放荡闺蜜高h季红豆h | 亲嘴扒胸摸屁股免费视频日本网站 | 中文字幕制服丝袜 | 91国内在线 | 日本一区不卡视频 | 男人懂的网站 | 91九色中文 | 91精品国产高清91久久久久久 | 成人深夜福利在线观看 | 精人妻一区二区三区 | 日韩一区二区三区三四区视频在线观看 | 亚洲超碰在线观看 | 国产精品99久久久久久久女警 | 日韩二三区 | 少妇高潮灌满白浆毛片免费看 | 人妻人人澡人人添人人爽 | 亚洲午夜色| 香蕉毛片| 亚洲精品国偷拍自产在线观看蜜桃 | 久久久黄色网 | 天天看天天操 | 亚洲视频2| 精品香蕉视频 | 欧洲激情网 | 亚洲片在线观看 | 国产精品一区二区欧美 | 浓精喷进老师黑色丝袜在线观看 | 美女搞黄视频网站 | 久久久精品中文字幕麻豆发布 | 日韩精品一区二区三区不卡 | 人人干美女 | 少妇系列在线观看 | 91亚洲一线产区二线产区 | 欧美激情爱爱 | 日美毛片| 精品一区二区三区电影 | 少妇饥渴放荡91麻豆 | 国产精品99久久久久久宅男 | 97av免费视频| 日韩一区二区三区网站 | 超碰人人网| 激情综合影院 | 自拍偷拍精品视频 | 尹人在线视频 | 在线视频免费播放 | 懂色av一区二区三区蜜臀 | 亚洲天堂性| 亚洲成人高清在线 | 精品欧美一区二区三区成人 | 仙踪林久久久久久久999 | 亚洲天堂视频在线播放 | 国产一级免费大片 | 久久男人 | 日韩欧美一区二区视频 | 91色在线| jizz少妇 | 天堂а√在线中文在线鲁大师 |