看板 HSNU_979 關於我們 聯絡資訊
第四使徒 Write a program to factor a number. All the prime factors should be listed in increasing order, and the power should be listed.The input is a positive number N. 1 < N < 100000000. The output format is defined as follows. The prime numbers should be listed in increasing order, and their powers should be concatenated to the prime factor, with a '^' in between. There should be a 'x' between two factors, and there should be a space after and before the 'x'.Note that this problem requires rigid output format. Please follow it PRECISELY No arrays allowed. Sample Input 123456 Output 2^6 x 3^1 x 643^1 input 65536 output 2^16 input 8763 output 3^1 x 23^1 x 127^1 input 99887766 output 2^1 x 3^1 x 11^1 x 31^1 x 48821^1 各位親愛的同學 如果有人能寫出來我會很感激 禁止使用陣列 題目應該很清楚 下星期要烤兩科 又要再交這個作業...我快稱不住了 最近真的覺得好累 不過我還是會自己寫啦 只有自己做作業才會進步 只是我怕我沒有那麼多的時間去寫 星期二就要交了 有人最近比較有空或是想動動腦袋的就做做看吧.... 如果我真的寫不出來就只好向你們求救了...!!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.192.240.19