- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
6 Posted Topics
Re: This should be considerably although I'd bet not noticeably faster. [code] #include <iostream> using namespace std; int main (){ int prim=3, div,i=2; cout<<1<<" "<<2<<" "; for (i; i<=500; i++){ div=3; while(div<=prim/3){ if (prim%div!=0){div+=2;} else {prim+=2;div=3;}} cout<<prim<<" "; prim+=2;} system("pause");} [/code] Why do you care about the speed anyways? | |
I'm interested in creating a bruteforce program. What is the most computer resource efficient method to count in base 62? (1,2,3...a,b,c...A,B,C) | |
I've been teaching myself C++ for the last two weeks. One of the things that was difficult for me to find on google was using the left click on a certain coordinate on the screen. The goal is to eventually be able to recognize images on the screen and alter … | |
Re: Sure, I'm new to C++ myself. I've been teaching it to myself for 8 hours a day for the last 2-3 weeks. I'd be glad to help if you need help catching up. PM me you MSN. | |
Re: Should work. I'm leaving to go home and won't both going through it. [code]#include <iostream> #include <fstream> using namespace std; int main(){ int i=0,m=2,a,b,c,f=2; while (i<1000){ a=2*m; b=m*m-1; c=m*m+1; while (f<=a){ if (a%f!=0 and b%f!=0 and c%f!=0){ f++;}} if (f=a+1){cout<<a<<", "<<b<<", "<<c; i++;}} system("pause");} [/code] | |
Re: char response; for (number=5; response!='Y' and response != 'y';) |
The End.