Jump to content
xisto Community

iikwalsemsiskweyrd

Members
  • Content Count

    10
  • Joined

  • Last visited

Posts posted by iikwalsemsiskweyrd


  1. #include <iostream>#include <cmath>using namespace std;bool isPrime( int i );int main(){	for( size_t i = 1; i < 1000; i++ )	{		if( isPrime( i ) )		{			cout<<i<<endl;		}	}	system( "pause" );	return 0;}bool isPrime( int num ){	int limit = sqrt( static_cast<double>(num) );	if ( num == 2 )	{		return true;	}	if ( num == 1 || num % 2 == 0 )	{		return false;	}	for( size_t i = 3; i <= limit; i += 2 )	{		if( num % i == 0 )		{			return false;		}	}	return true;}

    *system( "pause") was placed for the MSVS console not to automatically close. *newline at the end of the file if you are compiling with GCC.


  2. If you mean an HTML editor as in "a software that edits HTML files per se", I could say that gedit is the best in business. Notepad++ is also good but it is so Windows-y. If you mean an HTML editor as in "a WYSIWYG app with a drag and drop UI" then I think Dreamweaver is a good choice, though I'm not sure of it since I code HTML manually.


  3. Looks cool but I'm doubting it's responsiveness. Can Google cloud servers handle a worst case scenario wherein every netbook user shifts to Chromium? Or if all Chinese people are to use Chromium? :angel: I guess lightweight processing such as typing, spreadsheets, etc. is manageable but what about programming or gaming tasks? Or is media playing possible? This issue must be addressed since majority of computer users including me easily get frustrated when the GUI lags every now and then. haha. Overall, its a good concept but they must really work on the front end to the extent that users cannot differentiate between Chromium and the traditional stand alone OS in terms of GUI responsiveness.


  4. #include <iostream>#include <sstream>using namespace std;void tallyNums( int [] );int tally[] = {0,0,0,0,0,0,0,0,0,0};int main(){	while ( true )	{		int num[3] = {0};		cout<<"Enter 3 Numbers: ";		cin>>num[0]>>num[1]>>num[2];		tallyNums( num );		cout<<"No. of Zero/s: "<<tally[0]<<endl;		int otherNums = 0;		for( size_t i = 1; i < 10; i++ )		{			otherNums += ( ( tally[i] >= 1 ) ? 1:0 );		}		cout<<"Other numbers: "<<otherNums<<endl;		cout<<"Menu \n [A]dd \n [M]ultiply \n A[v]erage \n E[x]it\n Enter choice:";		string choice;		double out = 0;		string op = "";		cin>>choice;		if( choice == "A" || choice == "a" )		{			out = num[0] + num[1] + num[2];			op = "sum";		}		else if( choice == "M" || choice == "m" )		{			out = num[0] * num[1] * num[2];			op = "product";		}		else if( choice == "V" || choice == "v" )		{			out = ( num[0] + num[1] + num[2] ) / 3.0;			op = "average";		}		else if( choice == "X" || choice == "x" )		{			break;		}		else		{			cout<<"error"<<endl;		}		cout<<"The "<<op<<" is "<<out<<endl;	}	return 0;}void tallyNums( int nums[] ){		ostringstream oss;	oss<<nums[0]<<nums[1]<<nums[2];	string x = oss.str();	for( size_t i = 0; i < x.size(); i++ )	{		tally[x[i] - '0']++;	}}

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.