不清楚哪不對(duì)?
#include
int main() { ? ?int sale=120; //銷(xiāo)售業(yè)績(jī)?yōu)?20萬(wàn) ? ?int year=1; //剛剛進(jìn)入公司1年 ? ?//完善代碼 ? ? if(year>=2&&sale>100) ? ?{ ? ? ? ?printf("恭喜你獲獎(jiǎng)了"); ? ?} ? ?else ? ? ? ?printf("很遺憾,期望你再接再厲"); ? ?return 0; } 哪不對(duì)????
2015-11-28
package yun;
public class knife {
public static void main(String[] args){
knife hello=new knife();
? ? ? ? // 調(diào)用方法,傳入兩門(mén)課程的成績(jī)
hello.calcAvg(94, 81);
}
/*
* 功能:計(jì)算兩門(mén)課程考試成績(jī)的平均分并輸出平均分
* 定義一個(gè)包含兩個(gè)參數(shù)的方法,用來(lái)傳入兩門(mén)課程的成績(jī)
*/
? ? ? ? public int calcAvg(int num1,int num2) {
? ? ? ? ? ? double num3=(num1+num2)/2;
? ? ? ? ? ? System.out.println("平均分:"+num3);
? ? ? ? }
}
求大神
2015-07-29
#include<stdio.h>?