⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 求一系列数的和.txt

📁 c语言多个实用小程序,会有帮助的~ 自己瞎编的
💻 TXT
字号:
using System;
 
class Class1

{
	
public static int x;
	
public static int y;
	
public static long temp=0;
	
public static long sum=0;
	
public static void Main()
	
{
		
Console.WriteLine ("请输入所要求这一系列数的和的个数:");
		
x=int.Parse (Console.ReadLine ());
		
Console.WriteLine ("请输入这一系列数的基数:");
		
y=int.Parse (Console.ReadLine ());
		
for(int i=1;i<=x;i++)
		
{
			
int temp=y;
					
		
for(int j=1;j<i;j++)
			
{
							
temp=temp*10+y;
			
}
			
sum+=temp;
		
}
		
Console.WriteLine (sum);
		
Console.Read();
	
}

}   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -