网站公告 | 这是第三条公告我的广告
微信扫一扫 分享朋友圈

已有 54 人浏览分享

公式是否合法问题

[复制链接]
10001000
:4 天
:4 天

28

主题

5

回帖

33

积分

版主

Rank: 7Rank: 7Rank: 7

积分
33

[

发表于 3 天前 | 显示全部楼层 | 阅读模式 来自 中国山东淄博
#include<iostream>
#include<string>
using namespace std;
int main(){
    string gs;
    cin>>gs;
    //char a,b;
    int i,s;
    i=0;
    s=0;
    while(gs!='@' or s!=-1){
                if(gs=='('){
                        s++;
                }else{
                        if(gs==')'){
                                s--;
                        }else{
                                s=s;
                        }
                }
                i++;
        }
        if(s==0){
                cout<<"true";
        }else{
                cout<<"false";
        }
        return 0;
}
回复

使用道具 举报

文明发言,和谐互动
文明发言,和谐互动
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

0

关注

0

粉丝

28

主题

QQ|手机版|小黑屋|山东智趣岛论坛 ( 鲁ICP备2023024048号 )

GMT+8, 2025-7-4 10:24 , Processed in 0.259308 second(s), 53 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.