6銆?0閬揓AVA鍩虹缂栫▼缁冧範棰樿窡绛旀
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了6銆?0閬揓AVA鍩虹缂栫▼缁冧範棰樿窡绛旀相关的知识,希望对你有一定的参考价值。
鏍囩锛?/p>
1 50閬揓AVA鍩虹缂栫▼缁冧範棰? 2 銆愮▼搴?銆? 3 棰樼洰锛氬彜鍏搁棶棰橈細鏈変竴瀵瑰厰瀛愶紝浠庡嚭鐢熷悗绗?涓湀璧锋瘡涓湀閮界敓涓€瀵瑰厰瀛愶紝灏忓厰瀛愰暱鍒扮涓変釜鏈堝悗姣忎釜鏈堝張鐢熶竴瀵瑰厰瀛愶紝鍋囧鍏斿瓙閮戒笉姝伙紝闂瘡涓湀鐨勫厰瀛愭€绘暟涓哄灏戯紵 4 绋嬪簭鍒嗘瀽锛?鍏斿瓙鐨勮寰嬩负鏁板垪1,1,2,3,5,8,13,21.... 5 public class Prog1{ 6 public static void main(String[] args){ 7 int n = 10; 8 System.out.println("绗?+n+"涓湀鍏斿瓙鎬绘暟涓?+fun(n)); 9 } 10 private static int fun(int n){ 11 if(n==1 || n==2) 12 return 1; 13 else 14 return fun(n-1)+fun(n-2); 15 } 16 } 17 銆愮▼搴?銆? 18 棰樼洰锛氬垽鏂?01-200涔嬮棿鏈夊灏戜釜绱犳暟锛屽苟杈撳嚭鎵€鏈夌礌鏁般€? 19 绋嬪簭鍒嗘瀽锛氬垽鏂礌鏁扮殑鏂规硶锛氱敤涓€涓暟鍒嗗埆鍘婚櫎2鍒皊qrt(杩欎釜鏁?锛屽鏋滆兘琚暣闄わ紝鍒欒〃鏄庢鏁颁笉鏄礌鏁帮紝鍙嶄箣鏄礌鏁般€? 20 public class Prog2{ 21 public static void main(String[] args){ 22 int m = 1; 23 int n = 1000; 24 int count = 0; 25 //缁熻绱犳暟涓暟 26 for(int i=m;i<n;i++){ 27 if(isPrime(i)){ 28 count++; 29 System.out.print(i+" "); 30 if(count%10==0){ 31 System.out.println(); 32 } 33 } 34 } 35 System.out.println(); 36 System.out.println("鍦?+m+"鍜?+n+"涔嬮棿鍏辨湁"+count+"涓礌鏁?); 37 } 38 //鍒ゆ柇绱犳暟 39 private static boolean isPrime(int n){ 40 boolean flag = true; 41 if(n==1) 42 flag = false; 43 else{ 44 for(int i=2;i<=Math.sqrt(n);i++){ 45 if((n%i)==0 || n==1){ 46 flag = false; 47 break; 48 } 49 else 50 flag = true; 51 } 52 } 53 return flag; 54 } 55 } 56 銆愮▼搴?銆? 57 棰樼洰锛氭墦鍗板嚭鎵€鏈夌殑"姘翠粰鑺辨暟"锛屾墍璋?姘翠粰鑺辨暟"鏄寚涓€涓笁浣嶆暟锛屽叾鍚勪綅鏁板瓧绔嬫柟鍜岀瓑浜庤鏁版湰韬€備緥濡傦細153鏄竴涓?姘翠粰鑺辨暟"锛屽洜涓?53=1鐨勪笁娆℃柟锛?鐨勪笁娆℃柟锛?鐨勪笁娆℃柟銆? 58 绋嬪簭鍒嗘瀽锛氬埄鐢╢or寰幆鎺у埗100-999涓暟锛屾瘡涓暟鍒嗚В鍑轰釜浣嶏紝鍗佷綅锛岀櫨浣嶃€? 59 public class Prog3{ 60 public static void main(String[] args){ 61 for(int i=100;i<1000;i++){ 62 if(isLotus(i)) 63 System.out.print(i+" "); 64 } 65 System.out.println(); 66 } 67 //鍒ゆ柇姘翠粰鑺辨暟 68 private static boolean isLotus(int lotus){ 69 int m = 0; 70 int n = lotus; 71 int sum = 0; 72 m = n/100; 73 n -= m*100; 74 sum = m*m*m; 75 m = n/10; 76 n -= m*10; 77 sum += m*m*m + n*n*n; 78 if(sum==lotus) 79 return true; 80 else 81 return false; 82 } 83 } 84 銆愮▼搴?銆? 85 棰樼洰锛氬皢涓€涓鏁存暟鍒嗚В璐ㄥ洜鏁般€備緥濡傦細杈撳叆90,鎵撳嵃鍑?0=2*3*3*5銆? 86 绋嬪簭鍒嗘瀽锛氬n杩涜鍒嗚В璐ㄥ洜鏁帮紝搴斿厛鎵惧埌涓€涓渶灏忕殑璐ㄦ暟k锛岀劧鍚庢寜涓嬭堪姝ラ瀹屾垚锛? 87 (1)濡傛灉杩欎釜璐ㄦ暟鎭扮瓑浜巒锛屽垯璇存槑鍒嗚В璐ㄥ洜鏁扮殑杩囩▼宸茬粡缁撴潫锛屾墦鍗板嚭鍗冲彲銆? 88 (2)濡傛灉n<>k锛屼絾n鑳借k鏁撮櫎锛屽垯搴旀墦鍗板嚭k鐨勫€硷紝骞剁敤n闄や互k鐨勫晢,浣滀负鏂扮殑姝f暣鏁皀,閲嶅鎵ц绗竴姝ャ€? 89 (3)濡傛灉n涓嶈兘琚玨鏁撮櫎锛屽垯鐢╧+1浣滀负k鐨勫€?閲嶅鎵ц绗竴姝ャ€? 90 public class Prog4{ 91 public static void main(String[] args){ 92 int n = 13; 93 decompose(n); 94 } 95 private static void decompose(int n){ 96 System.out.print(n+"="); 97 for(int i=2;i<n+1;i++){ 98 while(n%i==0 && n!=i){ 99 n/=i; 100 System.out.print(i+"*"); 101 } 102 if(n==i){ 103 System.out.println(i); 104 break; 105 } 106 } 107 } 108 } 109 銆愮▼搴?銆? 110 棰樼洰锛氬埄鐢ㄦ潯浠惰繍绠楃鐨勫祵濂楁潵瀹屾垚姝ら锛氬涔犳垚缁?gt;=90鍒嗙殑鍚屽鐢ˋ琛ㄧず锛?0-89鍒嗕箣闂寸殑鐢˙琛ㄧず锛?0鍒嗕互涓嬬殑鐢–琛ㄧず銆? 111 绋嬪簭鍒嗘瀽锛?a>b)?a:b杩欐槸鏉′欢杩愮畻绗︾殑鍩烘湰渚嬪瓙銆? 112 public class Prog5{ 113 public static void main(String[] args){ 114 int n = -1; 115 try{ 116 n = Integer.parseInt(args[0]); 117 }catch(ArrayIndexOutOfBoundsException e){ 118 System.out.println("璇疯緭鍏ユ垚缁?); 119 return; 120 } 121 grade(n); 122 } 123 //鎴愮哗绛夌骇璁$畻 124 private static void grade(int n){ 125 if(n>100 || n<0) 126 System.out.println("杈撳叆鏃犳晥"); 127 else{ 128 String str = (n>=90)?"鍒嗭紝灞炰簬A绛?:((n>60)?"鍒嗭紝灞炰簬B绛?:"鍒嗭紝灞炰簬C绛?); 129 System.out.println(n+str); 130 } 131 } 132 } 133 銆愮▼搴?銆? 134 棰樼洰锛氳緭鍏ヤ袱涓鏁存暟m鍜宯锛屾眰鍏舵渶澶у叕绾︽暟鍜屾渶灏忓叕鍊嶆暟銆? 135 绋嬪簭鍒嗘瀽锛氬埄鐢ㄨ緱闄ゆ硶銆? 136 public class Prog6{ 137 public static void main(String[] args){ 138 int m,n; 139 try{ 140 m = Integer.parseInt(args[0]); 141 n = Integer.parseInt(args[1]); 142 }catch(ArrayIndexOutOfBoundsException e){ 143 System.out.println("杈撳叆鏈夎"); 144 return; 145 } 146 max_min(m,n); 147 } 148 //姹傛渶澶у叕绾︽暟鍜屾渶灏忓叕鍊嶆暟 149 private static void max_min(int m, int n){ 150 int temp = 1; 151 int yshu = 1; 152 int bshu = m*n; 153 if(n<m){ 154 temp = n; 155 n = m; 156 m = temp; 157 } 158 while(m!=0){ 159 temp = n%m; 160 n = m; 161 m = temp; 162 } 163 yshu = n; 164 bshu /= n; 165 System.out.println(m+"鍜?+n+"鐨勬渶澶у叕绾︽暟涓?+yshu); 166 System.out.println(m+"鍜?+n+"鐨勬渶灏忓叕鍊嶆暟涓?+bshu); 167 } 168 } 169 銆愮▼搴?銆? 170 棰樼洰锛氳緭鍏ヤ竴琛屽瓧绗︼紝鍒嗗埆缁熻鍑哄叾涓嫳鏂囧瓧姣嶃€佺┖鏍笺€佹暟瀛楀拰鍏跺畠瀛楃鐨勪釜鏁般€? 171 绋嬪簭鍒嗘瀽锛氬埄鐢╳hile璇彞,鏉′欢涓鸿緭鍏ョ殑瀛楃涓嶄负鈥榎n鈥?span style="color: #000000;">. 172 import java.util.Scanner; 173 public class Prog7_1{ 174 public static void main(String[] args){ 175 System.out.print("璇疯緭鍏ヤ竴涓插瓧绗︼細"); 176 Scanner scan = new Scanner(System.in); 177 String str = scan.nextLine();//灏嗕竴琛屽瓧绗﹁浆鍖栦负瀛楃涓?/span> 178 scan.close(); 179 count(str); 180 } 181 //缁熻杈撳叆鐨勫瓧绗︽暟 182 private static void count(String str){ 183 String E1 = "[\u4e00-\u9fa5]";//姹夊瓧 184 String E2 = "[a-zA-Z]"; 185 String E3 = "[0-9]"; 186 String E4 = "\\s";//绌烘牸 187 int countChinese = 0; 188 int countLetter = 0; 189 int countNumber = 0; 190 int countSpace = 0; 191 int countOther = 0; 192 char[] array_Char = str.toCharArray();//灏嗗瓧绗︿覆杞寲涓哄瓧绗︽暟缁?/span> 193 String[] array_String = new String[array_Char.length];//姹夊瓧鍙兘浣滀负瀛楃涓插鐞?/span> 194 for(int i=0;i<array_Char.length;i++) 195 array_String[i] = String.valueOf(array_Char[i]); 196 //閬嶅巻瀛楃涓叉暟缁勪腑鐨勫厓绱?/span> 197 for(String s:array_String){ 198 if(s.matches(E1)) 199 countChinese++; 200 else if(s.matches(E2)) 201 countLetter++; 202 else if(s.matches(E3)) 203 countNumber++; 204 else if(s.matches(E4)) 205 countSpace++; 206 else 207 countOther++; 208 } 209 System.out.println("杈撳叆鐨勬眽瀛椾釜鏁帮細"+countChinese); 210 System.out.println("杈撳叆鐨勫瓧姣嶄釜鏁帮細"+countLetter); 211 System.out.println("杈撳叆鐨勬暟瀛椾釜鏁帮細"+countNumber); 212 System.out.println("杈撳叆鐨勭┖鏍间釜鏁帮細"+countSpace); 213 System.out.println("杈撳叆鐨勫叾瀹冨瓧绗︿釜鏁帮細"+countSpace); 214 } 215 } 216 import java.util.*; 217 public class Prog7_2{ 218 public static void main(String[] args){ 219 System.out.println("璇疯緭鍏ヤ竴琛屽瓧绗︼細"); 220 Scanner scan = new Scanner(System.in); 221 String str = scan.nextLine(); 222 scan.close(); 223 count(str); 224 } 225 //缁熻杈撳叆鐨勫瓧绗?/span> 226 private static void count(String str){ 227 List<String> list = new ArrayList<String>(); 228 char[] array_Char = str.toCharArray(); 229 for(char c:array_Char) 230 list.add(String.valueOf(c));//灏嗗瓧绗︿綔涓哄瓧绗︿覆娣诲姞鍒發ist琛ㄤ腑 231 Collections.sort(list);//鎺掑簭 232 for(String s:list){ 233 int begin = list.indexOf(s); 234 int end = list.lastIndexOf(s); 235 //绱㈠紩缁撴潫缁熻瀛楃鏁?/span> 236 if(list.get(end)==s) 237 System.out.println("瀛楃‘"+s+"’鏈?+(end-begin+1)+"涓?); 238 } 239 } 240 } 241 銆愮▼搴?銆? 242 棰樼洰锛氭眰s=a+aa+aaa+aaaa+aa...a鐨勫€硷紝鍏朵腑a鏄竴涓暟瀛椼€備緥濡?+22+222+2222+22222(姝ゆ椂鍏辨湁5涓暟鐩稿姞)锛屽嚑涓暟鐩稿姞鏈夐敭鐩樻帶鍒躲€? 243 绋嬪簭鍒嗘瀽锛氬叧閿槸璁$畻鍑烘瘡涓€椤圭殑鍊笺€? 244 import java.util.Scanner; 245 246 public class Prog8{ 247 public static void main(String[] args){ 248 System.out.print("姹俿=a+aa+aaa+aaaa+...鐨勫€硷紝璇疯緭鍏鐨勫€硷細"); 249 Scanner scan = new Scanner(System.in).useDelimiter("\\s*");//浠ョ┖鏍间綔涓哄垎闅旂 250 int a = scan.nextInt(); 251 int n = scan.nextInt(); 252 scan.close();//鍏抽棴鎵弿鍣?/span> 253 System.out.println(expressed(2,5)+add(2,5)); 254 } 255 //姹傚拰琛ㄨ揪寮?/span> 256 private static String expressed(int a,int n){ 257 StringBuffer sb = new StringBuffer(); 258 StringBuffer subSB = new StringBuffer(); 259 for(int i=1;i<n+1;i++){ 260 subSB = subSB.append(a); 261 sb = sb.append(subSB); 262 if(i<n) 263 sb = sb.append("+"); 264 } 265 sb.append("="); 266 return sb.toString(); 267 } 268 //姹傚拰 269 private static long add(int a,int n){ 270 long sum = 0; 271 long subSUM = 0; 272 for(int i=1;i<n+1;i++){ 273 subSUM = subSUM*10+a; 274 sum = sum+subSUM; 275 } 276 return sum; 277 } 278 } 279 銆愮▼搴?銆? 280 棰樼洰锛氫竴涓暟濡傛灉鎭板ソ绛変簬瀹冪殑鍥犲瓙涔嬪拰锛岃繖涓暟灏辩О涓?瀹屾暟"銆備緥濡?=1锛?锛?.缂栫▼鎵惧嚭1000浠ュ唴鐨勬墍鏈夊畬鏁般€? 281 public class Prog9{ 282 public static void main(String[] args){ 283 int n = 10000; 284 compNumber(n); 285 } 286 //姹傚畬鏁?/span> 287 private static void compNumber(int n){ 288 int count = 0; 289 System.out.println(n+"浠ュ唴鐨勫畬鏁帮細"); 290 for(int i=1;i<n+1;i++){ 291 int sum = 0; 292 for(int j=1;j<i/2+1;j++){ 293 if((i%j)==0){ 294 sum += j; 295 if(sum==i){ 296 System.out.print(i+" "); 297 if((count++)%5==0) 298 System.out.println(); 299 } 300 } 301 } 302 } 303 } 304 } 305 銆愮▼搴?0銆? 306 棰樼洰锛氫竴鐞冧粠100绫抽珮搴﹁嚜鐢辫惤涓嬶紝姣忔钀藉湴鍚庡弽璺冲洖鍘熼珮搴︾殑涓€鍗婏紱鍐嶈惤涓嬶紝姹傚畠鍦?绗?0娆¤惤鍦版椂锛屽叡缁忚繃澶氬皯绫筹紵绗?0娆″弽寮瑰楂橈紵 307 import java.util.Scanner; 308 public class Prog10{ 309 public static void main(String[] args){ 310 System.out.print("璇疯緭鍏ュ皬鐞冭惤鍦版椂鐨勯珮搴﹀拰姹傝В鐨勬鏁帮細"); 311 Scanner scan = new Scanner(System.in).useDelimiter("\\s"); 312 int h = scan.nextInt(); 313 int n = scan.nextInt(); 314 scan.close(); 315 distance(h,n); 316 } 317 //灏忕悆浠巋楂樺害钀戒笅锛岀粡n娆″弽寮瑰悗缁忚繃鐨勮窛绂诲拰鍙嶅脊鐨勯珮搴?/span> 318 private static void distance(int h,int n){ 319 double length = 0; 320 for(int i=0;i<n;i++){ 321 length += h; 322 h /=2.0 ; 323 } 324 System.out.println("缁忚繃绗?+n+"娆″弽寮瑰悗锛屽皬鐞冨叡缁忚繃"+length+"绫筹紝"+"绗?+n+"娆″弽寮归珮搴︿负"+h+"绫?); 325 } 326 } 327 銆愮▼搴?1銆? 328 棰樼洰锛氭湁1銆?銆?銆?涓暟瀛楋紝鑳界粍鎴愬灏戜釜浜掍笉鐩稿悓涓旀棤閲嶅鏁板瓧鐨勪笁浣嶆暟锛熼兘鏄灏戯紵 329 绋嬪簭鍒嗘瀽锛氬彲濉湪鐧句綅銆佸崄浣嶃€佷釜浣嶇殑鏁板瓧閮芥槸1銆?銆?銆?銆傜粍鎴愭墍鏈夌殑鎺掑垪鍚庡啀鍘?鎺変笉婊¤冻鏉′欢鐨勬帓鍒椼€? 330 public class Prog11{ 331 public static void main(String[] args){ 332 int count = 0; 333 int n = 0; 334 for(int i=1;i<5;i++){ 335 for(int j=1;j<5;j++){ 336 if(j==i) 337 continue; 338 for(int k=1;k<5;k++){ 339 if(k!=i && k!=j){ 340 n = i*100+j*10+k; 341 System.out.print(n+" "); 342 if((++count)%5==0) 343 System.out.println(); 344 } 345 } 346 } 347 } 348 System.out.println(); 349 System.out.println("绗﹀悎鏉′欢鐨勬暟鍏憋細"+count+"涓?); 350 } 351 } 352 銆愮▼搴?2銆? 353 棰樼洰锛氫紒涓氬彂鏀剧殑濂栭噾鏍规嵁鍒╂鼎鎻愭垚銆傚埄娑?I)浣庝簬鎴栫瓑浜?0涓囧厓鏃讹紝濂栭噾鍙彁10%锛涘埄娑﹂珮浜?0涓囧厓锛屼綆浜?0涓囧厓鏃讹紝浣庝簬10涓囧厓鐨勯儴鍒嗘寜10%鎻愭垚锛岄珮浜?0涓囧厓鐨勯儴鍒嗭紝鍙彲鎻愭垚7.5%锛?0涓囧埌40涓囦箣闂存椂锛岄珮浜?0涓囧厓鐨勯儴鍒嗭紝鍙彁鎴?%锛?0涓囧埌60涓囦箣闂存椂楂樹簬40涓囧厓鐨勯儴鍒嗭紝鍙彁鎴?%锛?0涓囧埌100涓囦箣闂存椂锛岄珮浜?0涓囧厓鐨勯儴鍒嗭紝鍙彁鎴?.5%锛岄珮浜?00涓囧厓鏃讹紝瓒呰繃100涓囧厓鐨勯儴鍒嗘寜1%鎻愭垚锛屼粠閿洏杈撳叆褰撴湀鍒╂鼎I锛屾眰搴斿彂鏀惧閲戞€绘暟锛? 354 绋嬪簭鍒嗘瀽锛氳鍒╃敤鏁拌酱鏉ュ垎鐣岋紝瀹氫綅銆傛敞鎰忓畾涔夋椂闇€鎶婂閲戝畾涔夋垚闀挎暣鍨嬨€? 355 import java.io.*; 356 public class Prog12{ 357 public static void main(String[] args){ 358 System.out.print("璇疯緭鍏ュ綋鍓嶅埄娑︼細"); 359 long profit = Long.parseLong(key_Input()); 360 System.out.println("搴斿彂濂栭噾锛?+bonus(profit)); 361 } 362 //鎺ュ彈浠庨敭鐩樿緭鍏ョ殑鍐呭 363 private static String key_Input(){ 364 String str = null; 365 BufferedReader bufIn = new BufferedReader(new InputStreamReader(System.in)); 366 try{ 367 str = bufIn.readLine(); 368 }catch(IOException e){ 369 e.printStackTrace(); 370 }finally{ 371 try{ 372 bufIn.close(); 373 }catch(IOException e){ 374 e.printStackTrace(); 375 } 376 } 377 return str; 378 } 379 //璁$畻濂栭噾 380 private static long bonus(long profit){ 381 long prize = 0; 382 long profit_sub = profit; 383 if(profit>1000000){ 384 profit = profit_sub-1000000; 385 profit_sub = 1000000; 386 prize += profit*0.01; 387 } 388 if(profit>600000){ 389 profit = profit_sub-600000; 390 profit_sub = 600000; 391 prize += profit*0.015; 392 } 393 if(profit>400000){ 394 profit = profit_sub-400000; 395 profit_sub = 400000; 396 prize += profit*0.03; 397 } 398 if(profit>200000){ 399 profit = profit_sub-200000; 400 profit_sub = 200000; 401 prize += prize*0.05; 402 } 403 if(profit>100000){ 404 profit = profit_sub-100000; 405 profit_sub = 100000; 406 prize += profit*0.075; 407 } 408 prize += profit_sub*0.1; 409 return prize; 410 } 411 } 412 413 銆愮▼搴?3銆? 414 棰樼洰锛氫竴涓暣鏁帮紝瀹冨姞涓?00鍚庢槸涓€涓畬鍏ㄥ钩鏂规暟锛屽啀鍔犱笂168鍙堟槸涓€涓畬鍏ㄥ钩鏂规暟锛岃闂鏁版槸澶氬皯锛? 415 绋嬪簭鍒嗘瀽锛氬湪10涓囦互鍐呭垽鏂紝鍏堝皢璇ユ暟鍔犱笂100鍚庡啀寮€鏂癸紝鍐嶅皢璇ユ暟鍔犱笂268鍚庡啀寮€鏂癸紝濡傛灉寮€鏂瑰悗鐨勭粨鏋滄弧瓒冲涓嬫潯浠讹紝鍗虫槸缁撴灉銆? 416 public class Prog13{ 417 public static void main(String[] args){ 418 int n=0; 419 for(int i=0;i<100001;i++){ 420 if(isCompSqrt(i+100) && isCompSqrt(i+268)){ 421 n = i; 422 break; 423 } 424 } 425 System.out.println("鎵€姹傜殑鏁版槸锛?+n); 426 } 427 //鍒ゆ柇瀹屽叏骞虫柟鏁?/span> 428 private static boolean isCompSqrt(int n){ 429 boolean isComp = false; 430 for(int i=1;i<Math.sqrt(n)+1;i++){ 431 if(n==Math.pow(i,2)){ 432 isComp = true; 433 break; 434 } 435 } 436 return isComp; 437 } 438 } 439 銆愮▼搴?4銆? 440 棰樼洰锛氳緭鍏ユ煇骞存煇鏈堟煇鏃ワ紝鍒ゆ柇杩欎竴澶╂槸杩欎竴骞寸殑绗嚑澶╋紵 441 绋嬪簭鍒嗘瀽锛氫互3鏈?鏃ヤ负渚嬶紝搴旇鍏堟妸鍓嶄袱涓湀鐨勫姞璧锋潵锛岀劧鍚庡啀鍔犱笂5澶╁嵆鏈勾鐨勭鍑犲ぉ锛岀壒娈婃儏鍐碉紝闂板勾涓旇緭鍏ユ湀浠藉ぇ浜?鏃堕渶鑰冭檻澶氬姞涓€澶┿€? 442 import java.util.Scanner; 443 public class Prog14{ 444 public static void main(String[] args){ 445 Scanner scan = new Scanner(System.in).useDelimiter("\\D");//鍖归厤闈炴暟瀛?/span> 446 System.out.print("璇疯緭鍏ュ綋鍓嶆棩鏈燂紙骞?鏈?鏃ワ級:"); 447 int year = scan.nextInt(); 448 int month = scan.nextInt(); 449 int date = scan.nextInt(); 450 scan.close(); 451 System.out.println("浠婂ぉ鏄?+year+"骞寸殑绗?+analysis(year,month,date)+"澶?); 452 } 453 //鍒ゆ柇澶╂暟 454 private static int analysis(int year, int month, int date){ 455 int n = 0; 456 int[] month_date = new int[] {0,31,28,31,30,31,30,31,31,30,31,30}; 457 if((year%400)==0 || ((year%4)==0)&&((year%100)!=0)) 458 month_date[2] = 29; 459 for(int i=0;i<month;i++) 460 n += month_date[i]; 461 return n+date; 462 } 463 以上是关于6銆?0閬揓AVA鍩虹缂栫▼缁冧範棰樿窡绛旀的主要内容,如果未能解决你的问题,请参考以下文章