猫史档案馆


有谁会DEV-C++吗

用户:牢大编程师牢大编程师查看:20 回复:11 评论:20 创建时间:2024-07-24T13:07:49


有谁会DEV-C++吗


回复

上一页1 页 / 共 1下一页
mhdLing314mhdLing314

网上有教程

点赞0


评论


牢大编程师牢大编程师

我会,只是看看有没有也回的

点赞0


评论


牢大编程师牢大编程师

center_image

点赞1


评论


PlumStevenPlumSteven

真喜欢看刚入门新手的代码,仿佛又看见了那个大言不惭地说着一定要拿NOI金牌的我

点赞0


评论


OLEEEEEEEEEEEEEEEEEEOLEEEEEEEEEEEEEEEEEE

我会在里面写东西

点赞0


评论


牢大编程师牢大编程师

#include <iostream>
#include <string>
using namespace std;
int main()
{
	int a,b,o,t;
	string f;
	cout<<"输入第一个数,再输入运算符号,接着第二个数,然后enter\n"; 
	while(1){	//重复判断 
	cin>>a;
	cin>>f;
	cin>>b;
	if(f=="+"){	//加法运算 
		o=a+b;
		cout<<a<<"+"<<b<<"="<<o;
	}
	if(f=="-"){	//减法运算 
		o=a-b;
		cout<<a<<"-"<<b<<"="<<o;
	}
	if(f=="*"){	//乘法运算 
		o=a*b;
		cout<<a<<"*"<<b<<"="<<o;
	}
	if(f=="/"){	//除法运算 
		o=a/b;
		cout<<a<<"/"<<b<<"="<<o;
	}
	}
	return 0; 
}

点赞0


评论


进阶的柯南进阶的柯南

我不会dev-c++,但是我会c++(

点赞0


评论


牢大编程师牢大编程师

用while(1)死循环来重复判断

点赞0


评论


PlumStevenPlumSteven

1年前写的垃圾计算器

#include <bits/stdc++.h>
using namespace std;

stack<char> infixOperatorStack;
stack<long long> numberStack;

map<char, int> operatorPriority;

bool isDigit(char c){
	return (c>='0'&&c<='9');
}

int main()
{
	operatorPriority['+']=1;
	operatorPriority['*']=2;
	string in;
	cin>>in;
	string rpn; //后缀表达式
	for(int i=0;i<in.length();i++){
		if(isDigit(in[i])){
			rpn+=in[i];
		} else{ //是运算符
			rpn+="@"; //使用@分割每个数字
			while(!(infixOperatorStack.empty()||operatorPriority[in[i]]>operatorPriority[infixOperatorStack.top()])){
				rpn+=infixOperatorStack.top();
				infixOperatorStack.pop(); //如果优先级低,弹出
			}
			infixOperatorStack.push(in[i]);
		}
	}
	rpn+='@';
	while(!infixOperatorStack.empty()){ //弹出栈内所有操作符
		rpn+=infixOperatorStack.top();
		infixOperatorStack.pop();
	}
	long long num=0;
	for(int i=0;i<rpn.length();i++){
		if(isDigit(rpn[i])){
			num*=10;
			num+=(rpn[i]-'0');
		} else if(rpn[i]=='@'){
			numberStack.push(num%10000);
			num=0;
		} else{
			long long oa = numberStack.top();
			numberStack.pop();
			long long ob = numberStack.top();
			numberStack.pop();
			switch(rpn[i]){
				case '+':
					numberStack.push((oa+ob)%10000);
					break;
				case '*':
					numberStack.push((oa*ob)%10000);
					break;
			}
		}
	}
	if(!numberStack.empty()) cout<<numberStack.top();
	else{
		cout<<num;
	}
	return 0;
}

点赞0


评论


亿只啸喵总亿只啸喵总

玩儿dos给我g++删了,现在dev和vscode都飞起来了(

点赞0


评论


朱珅宇朱珅宇

#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
long long num;
cout << "请输入起始数字:";
cin >> num;

while(true)
{
cout << "当前数值:" << num << endl;
if(num % 2 == 1)
{
// 单数 乘以2
num = num * 2;
cout << "判定单数,执行 ×2\n";
}
else
{
// 双数 除以2再加1
num = num / 2 + 1;
cout << "判定双数,执行 ÷2 +1\n";
}
cout << "-----------------\n";
Sleep(1000); // 间隔1秒运算
}
return 0;
}

点赞0


评论