#include
using namespace std;
int main()
{ int number; int abs_number; // Ask for input cout = 0) { abs_number = number; } else abs_number = -number; // Print out output cout
#include
using namespace std;
class MyClass { int x, y;
public: MyClass(int i, int j) { x = i; y = j; } operator int() { return x*y; }
};
int main()
{ ...
#include
using namespace std;
template void bubble(X *data, int size)
{ register int a, b; X t; for(a=1; a < size; a++) for(b=size-1; b >= a; b--) if(data[b-1] > data[b]) { t ...
#include
#include
#include
#include
int main(void)
{
OSVERSIONINFO osver;
osver.dwOSVersionInfoSize = sizeof(osver);
if (GetVersionEx(&osver))
{
if (osver.dwPlatformId == VER_PLATFORM_WIN32s)
cout
#include
#include
int main()
{
cout
//read a character using cin
#include
#include
int main()
{
char mychar[100];
int i = 0;
//while the character is not a new line
while((mychar[i] = cin.get()) != '\n')
i++;
mychar[i] = NULL;
//display characters
cout
کدی برای محاسبه میانگین سه عدد
[CSHARP]#include
#include
int main()
{
int number1,number2,number3;
double average;
coutnumber2>>number3;
average = (number1 + number2 + number3) / 3.0;
cout
مثالی از دستور CIN در سی پلاس پلاس
CIN دستوری است برای دریافت رشته
#include
int main(void)
{
int number,highNumber;
coutnumber)
{
if(number > highNumber)
highNumber = number;
cout
#include
int main()
{
double fahr , celsius;
coutfahr;
//convert to celsius
celsius = (5.0 / 9.0) * (fahr - 32.0);
cout
با این کد ساده میتونید محتوای فایل رو با سی پلاس بخونید که خیلی از دانش آموزان و دانشجوها سوال میشه.
//this example opens a file called myfile.txt
//and reads the text message to it
#include
int main()
{
ifstream MyFile("myfile.txt");
char ch;
while(!MyFile.eof())
{
MyFile.get (ch);
cout
Create your first function in C++
#include
int AddIt(int x,int y)
{
return (x + y);
}
int main()
{
int a,b,c;
couta;
cin>>b;
//call the AddIt function
c = AddIt(a , b);
//display the answer
cout
//this example creates a file called myfile.txt
//and adds some text message to it
#include
int main()
{
ofstream MyFile("myfile.txt");
MyFile
#include
#include
int main(void)
{
cout
#include
#include
const char *FILENAME = "myfile.txt";
int main()
{
//create output object associated w/ file
ofstream fout(FILENAME);
cout > str;
//write the text to the file
fout
#include
int main()
{
enum Days{Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday};
Days TheDay;
int j;
coutj;
TheDay = Days(j);
if(TheDay == Sunday || TheDay == Saturday)
cout
/* This Program Will Encrypt Any Type Of Text Document */
#include
#include
#include
int main()
{
char name[30],target[30],ch,mod; //Declare
Variables
int num[100],i,option;
cout
#include
#include
#include
#include
#include
#include
struct s
{
unsigned long char c;
}
data;
int main()
{
char name[40],filename[40],ans;
long double size=0,i=0,j,parts,loop,mod=0,mod1=0,option,counter=0;
unsigned int handel,st=0;
long int status=0,whrex,whrey;
FILE *fp,*fp1;
cout
ایجاد شده در 10 سال پیش
سلام اگر میخواید تو برنامه ها مبناها رو به هم تبدیل کنید میتونید از این کد استفاده کنید.
#include // std::cout, std::dec, std::hex, std::oct
int main () { int n = 70; std::cout
بروز شده در 10 سال پیش
#include
#include
#include
//Stack
//www.softafzar.net
const int maxsize = 4; //4 is maximum size of our stack
int top = - 1;
int stack[maxsize];
void push(int x)
{ stack[++top] = x;
}
void pop(int &x)
{ if (top
سلام. من یه کد برای تشخیص عدداول نوشتم. وتی اجراش میکنم هیچ خطایی نمیده و کار نمیکنه!
اینم کدمه:
#include
#include
int main(int argc, char *argv[])
{ int a; int b; float r; printf("addady vared koind\n"); scanf("%d",&a); ...