猫史档案馆


SCS_user_EHQ0z2l6el

SCS_user_EHQ0z2l6el

Lv.1

获赞:26收藏:6浏览:351作品收藏:4

签名:清理黑历史

回复帖子评论
上一页4 页 / 共 7下一页

问题有点大。。。。。。 中回复

只能ps了,不然就做个卡通(

2023-02-26T12:42:50 点赞:0

盘点c++你常干的事情—— 中回复

挖坟

2023-03-15T12:01:59 点赞:0

迪迦奥特曼作品的最新进度1 中回复

2023-03-15T12:07:49 点赞:1

【新地图】《文明》 中回复

我去,全能

2023-03-19T22:16:48 点赞:0

后缀表达式+后缀表达式求值思路(c++教学) 中回复

//后缀表达式求值
#include<iostream>
#include<cstdio>
#include<stack>
using namespace std;
stack <double> s;//栈
double popfront(){
    double a=s.top();
    s.pop();
    return a;
}
int main(){
    string x;
    while(cin>>x){
        if('0'<=x[0]&&x[0]<='9'){
            int num=stod(x);
            s.push(num);
            continue;
        }
        double a=popfront();
        double b=popfront();
        if(x[0]=='+'){
            s.push(b+a);
        }
        if(x[0]=='-'){
            s.push(b-a);
        }
        if(x[0]=='*'){
            s.push(b*a);
        }
        if(x[0]=='/'){
            s.push(b/a);
        }
    }
    printf("%.1f",popfront());
    return 0;
}

2023-04-20T21:39:43 点赞:0

求助怎么办 中回复

发图片,不要只问问题

2023-04-20T21:41:49 点赞:1

【Python作品分享】贪吃蛇 中回复

可以,技术流

2023-04-20T21:42:28 点赞:0

中缀转后缀思路(c++教学) 中回复

//中转后缀表达式
#include<iostream>
#include<cstdio>
#include<stack>
using namespace std;
stack <char> s;//栈
char popfront(){
    char a=s.top();
    s.pop();
    return a;
}
int pri(char a){
    switch(a){
        case '(':
        case ')':return 0;
        case '+':
        case '-':return 1;
        case '*':
        case '/':return 2;
    }
    return 0;
}
int main(){
    string x;
    cin>>x;
    for(int i=0;i<x.size();i++){
        if('0'<=x[i]&&x[i]<='9'){
            int num=0;
            while(1){
                num*=10;
                num+=x[i]-'0';
                if((i+1>=x.size())||('0'>x[i+1]||x[i+1]>'9')){
                    break;
                }
                i++;
            }
            cout<<num<<" ";
            continue;
        }
        //后面就是符号处理
        if(x[i]=='('||s.empty()||(!s.empty() && pri(s.top())<pri(x[i]))){//无脑压入条件:左括号,栈为空,栈顶符号优先级小于当前符号
            s.push(x[i]);
        }else if(x[i]==')'){
            while(s.top()!='(')
                cout<<popfront()<<" ";
            s.pop();
        }else{
            while(s.size()&&pri(s.top())>=pri(x[i]))
                cout<<popfront()<<" ";
            s.push(x[i]);
        }
    }
    while(!s.empty()){
        cout<<popfront()<<" ";
    }
    return 0;
}

2023-04-21T13:35:23 点赞:0

中缀转后缀思路(c++教学) 中回复

怎么计算后缀表达式:https://shequ.codemao.cn/community/534701

2023-04-21T22:50:06 点赞:0

中缀转后缀思路(c++教学) 中回复

下期想看什么记得评论哦~(红黑树不行)

2023-04-22T15:48:57 点赞:0

#年度优秀地图# ⭐学科之星⭐ 中回复

挖坟

2023-04-24T20:07:32 点赞:1

我需要求助 中回复

不等于,比如1!=2结果就是true

2023-04-25T20:48:28 点赞:0

数据的结构与算法概念、算法复杂度(c++教学) 中回复

上期链接:https://shequ.codemao.cn/community/537172

2023-04-25T21:47:02 点赞:0

数据的结构与算法概念、算法复杂度(c++教学) 中回复

这个算基础的,值得学习,所以顶一下

2023-04-26T20:20:36 点赞:0

整数的表示(c++教学) 中回复

上期回顾:https://shequ.codemao.cn/community/537721

记得多评论哦~

2023-04-27T21:09:40 点赞:0

整数的表示(c++教学) 中回复

这种教学类的一般就不顶了吧,感兴趣可以直接搜“c++教学”就能搜到

2023-04-27T21:12:55 点赞:0

有关结构的一个问题 中回复

详情可以去看 https://shequ.cod喵/community/537721

2023-05-02T18:20:24 点赞:0

整数的表示(c++教学) 中回复

捞)

2023-05-02T18:21:22 点赞:0

【代码岛3.0】Architect工作室招新!() 中回复

我很好奇我怎么进的)

2023-05-02T20:43:00 点赞:0

冒泡排序(c++教学) 中回复

#include<iostream>
using namespace std;
int main(){
    int a[1000],n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    for(int i=0;i<n-1;i++){
        for(int j=0;j<n-i-1;j++){
            if(a[j]>a[j+1])swap(a[j],a[j+1]);
        }
    }
    for(int i=0;i<n;i++)
        cout<<a[i]<<" ";
    cout<<endl;
    return 0;
}

2023-05-02T21:48:26 点赞:0

插入、选择排序(c++教学) 中回复

#include<iostream>
using namespace std;
int a[1000],n;
void print(){
    for(int i=0;i<n;i++)
        cout<<a[i]<<" ";
    cout<<endl;
}
void bubble(){//冒泡
    for(int i=0;i<n-1;i++){
        for(int j=0;j<n-i-1;j++){
            if(a[j]>a[j+1])swap(a[j],a[j+1]);
        }
    }
}
void select(){//选择
    for(int i=0;i<n-1;i++){
        int max=a[i],maxindex=i;
        for(int j=n-1;j>i+1;j--){
            if(max>a[j]){
                max=a[j];
                maxindex=j;
            }
        }
        swap(a[i],a[maxindex]);
    }
}
void insert(){//插入
    for(int i=1;i<n;i++){
        for(int j=i;j>0;j--){
            if(a[j-1]>a[j])swap(a[j-1],a[j]);
        }
    }
}
int main(){
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    // bubble();
    select();
    // insert();
    print();
    return 0;
}

2023-05-03T11:56:33 点赞:0

插入、选择排序(c++教学) 中回复

投票:下次讲什么

A、桶排序/计数排序

B、快速排序

C、归并排序

D、堆排序(不建议)

E、希尔/鸡尾酒排序

2023-05-03T11:59:52 点赞:0

【c++】sort排序函数 中回复

#iclude<bits/stdc++.h>

这是万能头文件

2023-05-03T12:28:44 点赞:0

后缀表达式+后缀表达式求值思路(c++教学) 中回复

补发一下,之前投错地方了QAQ

2023-05-03T12:31:03 点赞:0

后缀表达式+后缀表达式求值思路(c++教学) 中回复

//后缀表达式求值
#include<iostream>
#include<cstdio>
#include<stack>
using namespace std;
stack <double> s;//栈
double popfront(){
    double a=s.top();
    s.pop();
    return a;
}
int main(){
    string x;
    while(cin>>x){
        if('0'<=x[0]&&x[0]<='9'){
            int num=stod(x);
            s.push(num);
            continue;
        }
        double a=popfront();
        double b=popfront();
        if(x[0]=='+'){
            s.push(b+a);
        }
        if(x[0]=='-'){
            s.push(b-a);
        }
        if(x[0]=='*'){
            s.push(b*a);
        }
        if(x[0]=='/'){
            s.push(b/a);
        }
    }
    printf("%.1f",popfront());
    return 0;
}

2023-05-03T12:31:36 点赞:0

【神奇代码岛】更适合岛民剪辑师体质的剪辑小技巧 中回复

前排

2023-05-12T18:19:51 点赞:0

神了!居然和我的網名撞車了 中回复

这么重要的消息赶紧上报给UN啊??????

2023-05-14T10:21:23 点赞:0

《在论坛抢沙发并发广告这回事》 中回复

这么重要的消息赶紧上报UN让全世界的人知道啊!!!

2023-05-14T10:24:55 点赞:0

【互动游戏】一人玩句梗吧,看看楼主能不能接上 中回复

这就是猫站低龄化的证明,也是为什么风气远不及以前的原因

2023-05-14T10:26:23 点赞:0

【教程】教你在自己的nemo作品里面使用自制排行榜(非官方私云排行榜) 中回复

猫站需要的就是这种类型的,这种教程对于猫站的影响是深刻的,就好比鲁迅对于我国文化的影响一样

2023-05-14T10:28:07 点赞:3