}
intmain()
{intn,i,j;
scanf("%d",&n);
for(i=1;i" />
首页 > 软件 > 求大佬帮忙写代码

求大佬帮忙写代码

软件 2022-11-13

c语言,求求编程大佬帮忙写代码

#include
voidoutputstar(intn)
{for(;n--;)printf("*");
}
intmain()
{intn,i,j;
scanf("%d",&n);
for(i=1;i<=n;i++)
{for(j=0;jprintf("");
outputstar(2*i-1);
printf("\n");
}
return0;
}

用C#写代码,求大佬帮忙(⋟﹏⋞)?

按照题目要求编写的C#程序如下

using System;

class Pet{

public virtual void show(){}

public String name;

public int age;

public Pet(String name,int age){

this.name=name;

this.age=age;

}

}

class Dog : Pet{

public String myFood;

public override void show(){

Console.WriteLine("这只名叫"+name+"的小狗今年"+age+"岁,爱吃"+this.myFood+"。");

}

public Dog(String name,int age,String myFood):base(name,age){

this.myFood=myFood;

}

}

class Cat : Dog{

public Cat(String name,int age,String myFood):base(name,age,myFood){}

public override void show(){

Console.WriteLine("这只名叫"+name+"的小猫今年"+age+"岁,爱吃"+myFood+"。");

}

}

class Program{

static void Main(string[] args){

Pet []p=new Pet[4];

p[0]=new Dog("大黑",1,"骨头");

p[1]=new Dog("小七",2,"面包");

p[2]=new Cat("公主",2,"鱼");

p[3]=new Cat("花花",1,"牛肉");

for(int i=0;i

p[i].show();

}

Console.ReadKey();

}

}

大佬帮忙给写下代码?

字符串本身就有截取方法、 substring(start, end) 截取字符串; substr(start, num截取字符串长度)

求帮忙写一段Python3 代码

这样

old_number = input('input number:')
new_number = ''
for i in range(10000):
new_number = old_number.replace('****','{:0>4}'.format(i))
print(new_number)

求大佬帮我写一个练习口算的vbs代码

复制粘贴到记事本,另存为xx.vbs,编码选ANSI

rem两位数加法口算/心算练习小程序
number1="10~99"
number2="10~99"
operators=Array("+")
count=10
a=split(number1,"~"):b=split(number2,"~")
Fori=1tocount
Randomize
o=Int(rnd*(Ubound(operators)+1))
Ifoperators(o)="x"Then
operators(o)="*"
EndIf
Ifoperators(o)="÷"Then
operators(o)="/"
EndIf
DoWhileTrue
n1=Int(rnd*(a(1)-a(0)+1)+a(0))
n2=Int(rnd*(b(1)-b(0)+1)+b(0))
formula=CStr(n1)&operators(o)&CStr(n2)
Ifoperators(o)="/"Then
t=n1Modn2
Ift=0Then
ExitDo
EndIf
Else
ExitDo
EndIf
Loop
DoWhileTrue
n=inputbox(CStr(i)&"、"&formula&"=?","MentalArithmetic")
Ifn=""Then
ExitDo
Else
Ifn=CStr(Eval(formula))Then
msgbox"correct"&vbCrLf&formula&"="&n,,"Bingo"
ExitDo
Else
msgbox"incorrect",,"Sorry"
EndIf
EndIf
Loop
Next

标签:编程 信息技术 编程语言 C语言 CC++

大明白知识网 Copyright © 2020-2022 www.wangpan131.com. Some Rights Reserved. 京ICP备11019930号-18