[學業]C++作業二

看板NTUBIME-99作者 (ice)時間19年前 (2006/10/26 17:31), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
// classtest.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std ; int _tmain(int argc, _TCHAR* argv[]) { int PrimeNumber = 1; for(int i=1 ; i<100 ;i++) { for(int j=2 ;j<i; j++) { if (( i % j ) == 0) { PrimeNumber = 0; break; } else PrimeNumber = 1; } if ( PrimeNumber==1 ) { cout << " " << i; } PrimeNumber = 0; } cin.get(); return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.183.73 apple579:轉錄至看板 NTUBIME99-HW 10/26 22:49
文章代碼(AID): #15G826jP (NTUBIME-99)