摘要: #include "stdio.h" int sqrt(int question); void main(void) { int question=49,answer; answer=sqrt(question); if(question<0) { printf("Error:sqrt return 阅读全文
posted @ 2020-02-11 20:29 七只蚂蚁 阅读(633) 评论(0) 推荐(0)
摘要: #include "stdio.h" double pow(double x,double y); void main(void) { double result; double x=2.0,y=3.0; result=pow(x,y); printf("%f的%f次方为%f",x,y,result 阅读全文
posted @ 2020-02-10 17:06 七只蚂蚁 阅读(438) 评论(0) 推荐(0)
摘要: package com.itranswarp.learnjava; /** * Is primary student? */ public class PrimaryStudent { public static void main(String[] args) { int age = 7; // 阅读全文
posted @ 2020-02-08 16:39 七只蚂蚁 阅读(1058) 评论(0) 推荐(0)
摘要: 出错代码 r2=(-b-sqrt(b*b-4*a*c))/2*a; 正确代码 r2=(-b-Math.sqrt(b*b-4*a*c))/2*a; 阅读全文
posted @ 2020-02-08 15:10 七只蚂蚁 阅读(784) 评论(0) 推荐(0)
摘要: package com.itranswarp.learnjava; /** * 求解 一元二次方程ax^2+bx+c=0 */ public class Main { public static void main(String[] args) { // x*x + 3*x - 4 = 0 doub 阅读全文
posted @ 2020-02-08 15:05 七只蚂蚁 阅读(1802) 评论(0) 推荐(0)
摘要: 类名要求:必须以英文字母开头,后接字母,数字,下滑线组合 大写字母开头 eg:Hello,NoteBook 方法名:首字母小写;eg:goodMorning 整型能表示的最大范围 byte:-128--127 short:-32768--32767 int:-2147483648 214748364 阅读全文
posted @ 2020-02-07 14:16 七只蚂蚁 阅读(112) 评论(0) 推荐(0)
摘要: string cannot be resolved to a type 1.大小写错误 阅读全文
posted @ 2020-02-06 21:35 七只蚂蚁 阅读(804) 评论(0) 推荐(0)
摘要: #include "stdio.h"void main(){ int a[2][3]={{1,2,3},{4,5,6}}; int i,j,b[3][2]; for(i=0;i<2;i++) { for(j=0;j<3;j++) { printf("%5d",b[i][j]); b[j][i]=a[ 阅读全文
posted @ 2020-02-06 16:01 七只蚂蚁 阅读(625) 评论(0) 推荐(0)
摘要: #include "stdio.h" #define M 10 void main() { int a[M]={-12,0,6,16,23,56,80,100,110,115}; int mid,high,low,n,found; low=0; high=M-1; found=0; printf(" 阅读全文
posted @ 2020-02-06 15:32 七只蚂蚁 阅读(493) 评论(0) 推荐(0)
摘要: #include "stdio.h" void main() { int a[3][4]={{65,48,78,90},{78,92,45,66},{77,44,66,55}}; int i,j,max=a[0][0],row,colum; for(i=0;i<3;i++) { for(j=0;j< 阅读全文
posted @ 2020-02-06 11:46 七只蚂蚁 阅读(3396) 评论(0) 推荐(0)