
Lv.1
只是喜欢Python而已……徒弟:程序侯
签名:只是喜欢Python而已…… 徒弟:程序侯
在 来电cpp代码 中回复
#include <iostream>
using namespace std;
void output_char_times(char charater,int times)
{
for(int i = 0;i < times;i++)
{
cout << charater;
}a
}
void newline(void)
{
cout << endl;
}
void int_input(int* result,string msg)
{
cout << msg;
cin >> *result;
}
int main(int argc,char* argv)
{
const tree_down_lines = 3
int times,all_times;
int a;
input(&a,"几层树?");
for(int i = 0; i < a;i++)
{
times = 2*i + 1;
all_times = 2*a + 1;
output_char_times(' ',(all_times-times)/2)
output_charac_times('@',times)
output_char_times(' ',(all_times-times)/2)
}
for(int i = 0,i < tree_down_lines)
{
output_char_times(' ',(all_times-1)/2)
}
return 0;
}
2020-07-13T19:52:48 点赞:0
在 解密游戏!!! 中回复
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
2020-07-14T05:56:17 点赞:0
在 有人帮我做项目吗 中回复
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
2020-07-14T11:39:16 点赞:0
在 一个小趣味题 中回复
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
2020-07-14T12:48:27 点赞:0
在 一个小趣味题 中回复
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
2020-07-14T14:23:32 点赞:0
在 大的B T的大大大大大数![#1#] 中回复
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
2020-07-14T14:59:06 点赞:0
在 【编程猫·编程一小时】一起学编程 燃燎原之火 中回复
我家键盘手感太好了![]()
先不说了,多打点字符
#include <iostream>
using namespace std;
int main(int argc,char* argv[]){
int a,b;
char op;
cin >> a >> b >> op;
if(op == '+'){
cout << a+b <<endl;
} else if(op == '-'){
cout <<a-b <<endl;
} else if(op == '*'){
cout <<a*b << endl;
} else if(op == '/'){
if(b == 0){
cout << "Divided by zero!" << endl;
}else{
cout << a/b << endl;
}
}
else{
cout << "Invalid operator!" << endl;
}
return 0x0;
}
2020-07-14T15:00:58 点赞:0