01 2025 档案
摘要:Ctrl+Z 返回上一步Ctrl+X 剪切Ctrl+C 复制Ctrl+V 粘贴Ctrl+N 基于当前窗口新开另一窗口Ctrl+D 删除Ctrl+Y 回到下一步
阅读全文
摘要:#转换函数使用a,b=input().split(",")b=int(b)print(int(a,b))
阅读全文
摘要:#特殊a串数列求和a,n=input().split()n=int(n)s=0for i in range(n): s+=eval(a*(i+1))print("s =",s)
阅读全文
摘要:#输出华氏-摄氏温度转换表a,b=input().split()a,b=eval(a),eval(b)if(a>b): print("Invalid.")else: print("fahr celsius") i = a while i <= b: print("{:d}{:>6.1f}".form
阅读全文
摘要:s="Python语言简单易学" print(s.encode("utf-8"))
阅读全文
摘要:#求奇数分之一序列前N项和N=int(input())S=0t=1for i in range(N): S+=1/(t) t+=2print("sum = {:.6f}".format(S))
阅读全文
摘要:#求交错序列前N项和N=int(input())S=0t=1for i in range(N): if i%2==0: S=S+(i+1)/(t) t=(t+2) else: S=S-(i+1)/(t) t=(t+2)print("{:.3f}".format(S))
阅读全文
摘要:#阶梯电价e=float(input())cost=0if e<0: print("Invalid Value!")elif e<=50: cost=e*0.53 print("cost = {0:.2f}".format(cost))else: cost=50*0.53+(e-50)*0.58 p
阅读全文
摘要:#计算分段函数[1]x=float(input())if x==0: y=0else: y=1/xprint("f({0:.1f}) = {1:.1f}".format(x,y))
阅读全文
摘要:#计算 11+12+13+...+mm=int(input())sum=0for i in range(11,m+1): sum+=iprint("sum =",sum)
阅读全文
摘要:#从键盘输入三个数到a,b,c中,按公式值输出a,b,c=input().split()a=int(a)b=int(b)c=int(c)print(b*b-4*a*c)
阅读全文
摘要:A=int(input())B=int(input())print(A+B)
阅读全文
摘要:#产生每位数字相同的n位数A,B=input().split(",")A=A.strip()B=int(B.strip())print(int(A*B))
阅读全文
摘要:#比较大小print(*sorted(map(int,input().split())),sep="->")
阅读全文
摘要:ctrl+r 批量修改ctrl+s+r 全局批量修改ctrl+a+o 去掉多余包ctrl+f查找ctrl+s+f全局查找
阅读全文
摘要:1、字符串变量未初始化2、接口类型的对象没有用具体的类初始化,比如:Map map // 会报错Map map = new Map(); //则不会报错了3、当一个对象的值为空时,你没有判断为空的情况。4、字符串与文字的比较,文字可以是一个字符串或Enum的元素,如下会出现异常String str
阅读全文
摘要:Class file collision: A resource exists with a different case: '/Mooc/bin/mooc_4/animal.class'.类文件冲突:存在不同情况的资源:‘/mooc/bin/moc_4/antial.class’。 解决办法:定义
阅读全文
摘要:报错:Cannot reduce the visibility of the inherited method from Interface 原因:子类方法的访问权限低于基类该方法的访问权限。 解决办法:调整子类方法的访问权限大于或等于基类的访问权限。 解释:如果允许子类方法降低父类方法的权限,当通
阅读全文
摘要:1、项目名全部小写.2、包名全部小写.3、类名首字母大写,其余组成词首字母依次大写.4、变量名,方法名首字母小写,如果名称由多个单词组成,除首字母外的每个单词的首字母都要大写.5、常量名全部大写.6、所有命名规则必须遵循以下规则 :名称只能由字母、数字、下划线、$符号组成.不能以数字开头.名称不能使
阅读全文
摘要:Java的包名由小写单词组成,包的路径符合所开发的系统模块的定义,以便通过包名可得知其属于哪个模块,从而方便到对应包里找相应的实现类.常规包名为了保障每个Java Package命名的唯一性,在Java编程规范中要求开发人员在自己定义的包名前加上唯一的前缀.由于互联网上的域名称是不会重复的,所以多数
阅读全文
摘要:int c = Integer.valueOf(scanner.nextLine());
阅读全文
摘要:hasNextInt()方法是判断控制台接收是否为数字
阅读全文
摘要:加上单引号的:‘0’代表一个字符;s.charAt(i)方法:返回指定索引位置的字符;s.charAt(i)-'0':两个字符相减实际上是ASCII码对应的数相减;s.charAt(i)-'0'==digit:也就是s.charAt(i)-'0'的结果对应的ASCII码值(整数)与 digit(整数
阅读全文
摘要:抽象类不能实例化对象,所以抽象类必须被继承一个类只能继承一个抽象类,而一个类却可以实现多个接口静态方法只要定义了类,不必建立类的实例就可使用。静态方法只能调用静态变量。通过对象来使用,也可以通过类来使用 在构造方法中尽量避免调用任何方法,尽可能简单地使对象进入就绪状态,能够安全调用的是final的方
阅读全文
摘要:1)接口不能有构造方法,抽象类可以有。 2)接口不能有方法体,抽象类可以有。 3)接口不能有静态方法,抽象类可以有。 4)在接口中凡是变量必须是public static final,而在抽象类中没有要求。
阅读全文
摘要:[public] [abstact|final] class className [extends superclassName] [implements InterfaceNameList]{ //类声明 [public | protected | private] [static] [final
阅读全文
摘要://接口声明[public] interface interfaceName [extends listOfSuperInterface]{ …… } //接口的方法定义returnType methodName ( [paramlist] ); //接口的完整示例interface Collect
阅读全文
摘要:快速复制上一行 :Ctrl+Alt+向下箭头替换单词:Ctrl+F
阅读全文
摘要:1.Windows->Preferences2.左侧选择Java–>Code Style–> Code Temp3.右侧的上方框里,在 Code 下选择相关方法,选择后点击右侧 Edit…
阅读全文
摘要:单个文件使用:Ctrl+f整个项目使用:先选中要修改的东西,然后在菜单栏中search→text→project,然后在search的console中,单击项目,右键选中replace all,填入替换的内容
阅读全文
摘要:Window->Preferences->General->Editors->Text Editors->Annotations->Occurrences
阅读全文
摘要:1.windows-->Preferences-->Java --> Editor-->Save Actions2.勾选“Perform the selected actions on save(其他选项根据需要自己选择或者配置)
阅读全文
摘要:实现电脑同时登录两个微信账号: 1.使用回车键双击微信图标:在按住键盘上的回车键的同时,双击桌面上的微信图标,然后立刻松开回车键。但这种方法可能无法精确控制打开的微信窗口数量,有时可能会打开过多的窗口,导致电脑卡顿甚至死机。 2.使用bat命令:新建一个文本文档,并粘贴特定的命令,该命令会
阅读全文
摘要:// 学生信息录入系统2.0 #include<stdio.h>#include<string.h>#include<stdlib.h>#include<time.h>#include<conio.h>#include<Windows.h>#include<process.h> #define Ma
阅读全文
摘要:#include<stdio.h> //stdio.h 头文件定义了三个变量类型、一些宏和各种函数来执行输入和输出#include<stdlib.h> //stdlib .h 头文件定义了四个变量类型、一些宏和各种通用工具函数#include<windows.h> // 获取控制台窗口句柄 微软官方
阅读全文
摘要:#include<stdio.h>#include<string.h>void fsort(char*color[],int n);int main(){ int i; char*pcolor[]={"red","blue","yellow","green","black"}; fsort(pcol
阅读全文
摘要:#include<stdio.h>int main(int argc,char*argv[]){ int k; for(k=1;k<argc;k++){ printf("%s",argv[k]); } printf("\n"); return 0;}
阅读全文
摘要:#include<stdio.h>int main(){ int i; char*poem[4]={"一叶轻舟向东流,","帆梢轻握杨柳手,","风纤碧波微起舞,","顺水任从雅客悠。"}; char mean[10]; for(i=0;i<4;i++){ mean[2*i]=*(poem[i]);
阅读全文
摘要:#include<stdio.h>int main(){ int a=10; int *p=&a; int **pp=&p; printf("a=%d *p=%d **pp=%d\n",a,*p,**pp); printf("&a=%d p=%d *pp=%d\n",&a,p,*pp); print
阅读全文
摘要:#include<stdio.h>void fsort(int a[],int n);int main(void){ int i; int a[5]={6,5,2,8,1}; fsort(a,5); for(i=0;i<5;i++){ printf("%d",a[i]); } return 0;}v
阅读全文
摘要:#include<stdio.h>#include<string.h>int main(){ int i; char *color[5]={"red","blue","yellow","green","black"}; char str[20]; printf("Input a color:");
阅读全文
摘要:#include<stdio.h>#include<math.h>#define PI 3.141592654void cal(int sel);double vol_ball(void);double vol_cylind(void);double vol_cone(void);int main(
阅读全文
摘要:#include<stdio.h>#define Mile_to_meter 1609 //1英里等于1609米 #define Foot_to_centimeter 30.48 //1英尺=30.48厘米 #define Inch_to_centimeter 2.54 //1英寸=2.54厘米 i
阅读全文
摘要:#include<stdio.h>void hanio(int n,char a,char b,char c);int main(){ int n; printf("input the number of disk:"); scanf("%d",&n); printf("the steps for
阅读全文
摘要:#define Mile_to_meter 1609 //1英里等于1609米 #define Foot_to_centimeter 30.48 //1英尺=30.48厘米 #define Inch_to_centimeter 2.54 //1英寸=2.54厘米
阅读全文
摘要:#include<stdio.h>#define MAX(a,b) a>b?a:b#define SQR(x) x*xint main(void){ int x,y; scanf("%d%d",&x,&y); x=MAX(x,y); y=SQR(x); printf("%d %d\n",x,y);
阅读全文
摘要:#include<stdio.h>#include"length.h"int main(){ float foot,inch,mile; printf("Input mile,foot and inch:"); scanf("%f%f%f",&mile,&foot,&inch); printf("%
阅读全文
摘要:#include<stdio.h>double fact(int n);int main(){ int n; scanf("%d",&n); printf("%f",fact(n)); return 0;} double fact(int n){ double result; if(n==1||n=
阅读全文
摘要:#include<stdio.h>struct student { int num; char name[10]; int computer,english,math; double average;};int main(){ int i,index,j,n; struct student stud
阅读全文
摘要:#include<stdio.h>struct student { int num; char name[10]; int computer,english,math; double average;};int update_score(struct student *p,int n,int num
阅读全文
摘要:#include<stdio.h>struct student { int num; char name[10]; int computer,english,math; double average;};int main(){ int i,n; struct student s1,max; prin
阅读全文
摘要:#include<stdio.h>void swap1(int x,int y),swap2(int *px,int *py),swap3(int *px,int *py);int main(){ int a=1,b=2; int *pa=&a,*pb=&b; swap1(a,b); printf(
阅读全文
摘要:#include<stdio.h>int main(){ int a[2],*p,*q; p=&a[0]; q=p+1; printf("%d\n",q); printf("%d\n",p); printf("%d\n",q-p); printf("%d\n",*q-*p); return 0;}
阅读全文
摘要:#include<stdio.h>int main(){ int a=3,*p; p=&a; printf("a=%d,*p=%d\n",a,*p);//a=3,*p=3 *p=10; printf("a=%d,*p=%d\n",a,*p);//a=10,*p=10 printf("Enter a:
阅读全文
摘要:#include<stdio.h>void month_day(int year,int yearday,int*pmonth,int *pday);int main(){ int day,month,year,yearday; printf("input year and yearday:");
阅读全文
摘要:#include<stdio.h>void bubble(int a[],int n);int main(){ int n,a[8]; int i; printf("Enter n (n<=8):"); scanf("%d",&n); printf("Enter a[%d]:",n); for(i=
阅读全文
摘要:#include<stdio.h>int main(){ int x=5342; int *p=NULL; p=&x; printf("If I know the name of variable,I can get it's value by name:%d\n",x); printf("If I
阅读全文
摘要:#include<stdio.h>int main(){ int x,y; int *px,*py; x=1;y=2; px=&x;py=&y; printf("x=%d,y=%d,px=%d,py=%d,*px=%d,*py=%d\n",x,y,px,py,*px,*py); px++;//等同于
阅读全文
摘要:#include<stdio.h>int day_of_year(int year,int mouth,int day);int main(){ int year,mouth,day,date; printf("输入年月日:"); scanf("%d%d%d",&year,&mouth,&day);
阅读全文
摘要:#include<stdio.h>int main(){ int i,index,n; int a[10]; printf("Enter n:"); scanf("%d",&n); printf("Enter %d integers:",n); for(i=0;i<n;i++){ scanf("%d
阅读全文
摘要:#include<stdio.h>int main(){ int i,flag,x; int a[5]; printf("Enter 5 integers:"); for(i=0;i<5;i++){ scanf("%d",&a[i]); } printf("Enter x:"); scanf("%d
阅读全文
摘要:#include<stdio.h>int main(){ int i,index,k,n,temp; int a[10]; printf("Enter n:"); scanf("%d",&n); printf("Enter %d integers:",n); for(i=0;i<n;i++){ sc
阅读全文
摘要:#include<stdio.h>int main(){ int i,response; int count[9]; for(i=1;i<=8;i++){ count[i]=0; } for(i=1;i<=10;i++){ printf("Emter your response:"); scanf(
阅读全文
摘要:#include<stdio.h>int main(){ int count,i; char str[80]; printf("Enter a string:"); i=0; while((str[i]=getchar())!='\n'){ i++; } str[i]='\0'; count=0;
阅读全文
摘要:#include<stdio.h>int main(){ int i,number; char str[10]; printf("Enter a string:"); i=0; while((str[i]=getchar())!='\n'){ i++; } str[i]='\0'; number=0
阅读全文
摘要:#include<stdio.h>int main(){ //输出斐波那契数列 int i; int fib[10]={1,1}; for(i=2;i<10;i++){ fib[i]=fib[i-1]+fib[i-2]; } for(i=0;i<10;i++){ printf("%6d",fib[i
阅读全文
摘要:#include<stdio.h>int main(){ //输入10个数。输出所有大于平均数的值 int i; double average,sum; int a[10]; printf("Enter 10 integers:"); sum=0; for(i=0;i<10;i++){ scanf(
阅读全文
摘要:#include<stdio.h>int main(){ int i,index,n; int a[10]; printf("Enter n:"); scanf("%d",&n); printf("Enter %d integers:",n); for(i=0;i<n;i++){ scanf("%d
阅读全文
摘要:#include<stdio.h>int main(){ int col,i,j,row; int a[3][2]; printf("Enter 6 integers:\n"); for(i=0;i<3;i++){ for(j=0;j<2;j++){ scanf("%d",&a[i][j]); }
阅读全文
摘要:#include<stdio.h>int main(){ int i,k; char line[80]; printf("Enter a string:"); k=0; while((line[k]=getchar())!='\n'){ k++; } line[k]='\0'; i=0; k=k-1
阅读全文
摘要:#include<stdio.h>int main(){ int i,j,n,temp; int a[6][6]; printf("Enter n:"); scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ a[i][j]=i*n+j+1; } }
阅读全文
摘要:#include<stdio.h>int main(){ int i,j; int a[3][2]; for(i=0;i<3;i++){ for(j=0;j<2;j++){ a[i][j]=i+j; } } for(i=0;i<3;i++){ for(j=0;j<2;j++){ printf("%2
阅读全文
摘要:#include<stdio.h>#include<math.h>int reverse(int number);int main(){ int i; printf("输入一位整数:"); scanf("%d",&i); printf("它的逆序数是:%d",reverse(i)); return
阅读全文
摘要:#include<stdio.h>int main(){ int i; char ch_lower,ch_upper; printf("输入需要加密的6个小写字母组成的英文单词:"); for(i=1;i<=6;i++){ scanf("%c",&ch_lower); if(ch_lower>='a
阅读全文
摘要:#include<stdio.h>int main(){ char ch; printf("input characters:"); ch=getchar(); while(ch!='\n'){ if(ch>='A'&&ch<='Z') ch=ch-'A'+'a'; else if(ch>='a'&
阅读全文
摘要:#include<stdio.h>int max(int a,int b);int main(){ int m,n,MAX; printf("输入两个整数:"); scanf("%d%d",&m,&n); MAX=max(m,n); printf("较大数为:%d",MAX); return 0;}
阅读全文
摘要:#include<stdio.h>void pyramid(int n);int main(){ int m; printf("请输入你想要的金字塔层数:"); scanf("%d",&m); pyramid(m); return 0;}void pyramid(int n){ int i,j; f
阅读全文
摘要:#include<stdio.h>int sum(int m,int n);int main(){ int m1,n1,SUM; printf("输入m和n的值(m小于等于n):"); scanf("%d%d",&m1,&n1); SUM=sum(m1,n1); printf("%d",SUM);
阅读全文
摘要:#include<stdio.h>double cylinder(double r,double h);//函数声明 int main(){ double height,radius,volume; printf("Enter radius and height:");//提示输入半径和高度 sca
阅读全文
摘要:#include<stdio.h>#include<math.h>double dist(double x1,double y1,double x2,double y2);int main(){ double x1,x2,y1,y2,d; printf("输入x1:"); scanf("%lf",&
阅读全文
摘要:#include<stdio.h>int sign(int x);int main(){ int x,y; printf("输入自变量x:"); scanf("%d",&x); y=sign(x); printf("f(%d)=%d",x,y); return 0;}int sign(int x){
阅读全文