[LEFT]void pa(int n)
{
char c ,a[100];
ifstream q("soalat.txt");
ofstream p("pa.txt");
cout<<"-************************************************** \n\n";
cout<<"-************************************************** \n\n";
cout<<"\nplease enter pasokh gozineha ra :\n\n";
for(int i=1;i<=n;i++)
{
cout<<"\njavab soal "<<i<<" barabar :\n";
cin>>c;
a[i]=c;
p<<i<<" = "<<a[i]<<"\n";
}
}
void pasokh_sahih(int n)
{
ofstream pas ("pas.txt");
ifstream p("pa.txt");
char z[100];
cout<<" \nplease enter javab sahih soalat ra barai barrasi gozineha \n\n";
for(int i=1;i<=n;i++)
{ cout<<" \npasokh sahih soal "<<i<< " barabar =\n";
cin>>z[i];
pas<<i<<" = "<<z[i]<<"\n";
}
cout<<"-************************************************** \n\n";
}
void karname(int n)
{
ofstream k("kar.txt");
ifstream p("pa.txt");
ifstream pas ("c:\pas.txt");
int a1=0,z1=0;
char z[100],a[100],s[100];
for(int i=0;i<n;i++)
{
p>>a[i];
s[i]=a[i];
cout<<s[i];
pas>>z[i];
cout<<z[i];
if(z[i]==a[i])
a1++;
else
z1++;
}
cout<< "\nnumber javabhai sahih barabar \n\n";
cout<<a1;
k<< "\nnumber javabhai sahih barabar \n\n";
k<<a1;
cout<<"\n\nnumber javabhai ghalat barabar ba\n\n";
cout<<z1;
k<<"\n\nnumber javabhai ghalat barabar ba\n\n";
k<<z1;
[/LEFT]
[LEFT]cout<<"\nplease admin cod = \n";
cin>>coda;
cout<<"please enter number worker :\n";
cin>>n;
employee em;
char ch;
while(1)
{
clrscr();
cout<<"Select Option: ";
cout<<"\n\n i = input name ,hour , hp , base , codw :\n";
cout<<"\n p = print :\n";
cout<<"\n c = chang :\n";
ch=getch();
clrscr();
switch(ch)
{
case 'I':
case 'i':
{ for(int i=0;i<n;i++)
em.input();
em.calculate();}
break;
case 'P':
case 'p':
{ for(int i=0;i<n;i++)
em.print(); }
break;
case 'C':
case 'c':
{
for(int i=0;i<n;i++)
em.chang();
}
break;
default:
cout<<"\nsyntax error.";
}
cout<<"\nfor exit enter <n> else press any key:";
ch=getche();
if(ch=='n' || ch=='N')
break;
}
[/LEFT]
foreach(<baseType> <name> in <array>)
{
// can use <name> for each element
}
string[] friendNames = {"Robert Barwell", "Mike Parry",
"Jeremy Beacock"};
int i;
Console.WriteLine("Here are {0} of my friends:",
friendNames.Length);
for (i = 0; i < friendNames.Length; i++)
{
Console.WriteLine(friendNames[i]);
}
Console.ReadKey();
string[] friendNames = {"Robert Barwell", "Mike Parry",
"Jeremy Beacock"};
int i;
Console.WriteLine("Here are {0} of my friends:",
friendNames.Length);
foreach (string friendName in friendNames)
{
Console.WriteLine(friendName);
}
Console.ReadKey();
foreach (string friendName in friendNames)
{
friendName = "Rupert the bear";
}
class point{
int x,y;
public point(intx,int y){
this.x=x;
this.y=y;
}
}
"visual " + "studio"
intData[ [COLOR=red]i مقدار[/COLOR]]=[COLOR=red] j مقدار[/COLOR]
سلام واقعا مهندسای این باشگاه هیچ کدوم نمی توننن به من توc#کمک کنن این مهندسای کامپیوترمنقرض شدن یاخیسسن!!!!!!!
من سوال داشتم درمورد علامت جمع توی کروشه قبل وبعد ازI
for
(int i=0 ; i< intData.Length ; i++)
{
int
j = intData;
Console.WriteLine("intData[" + i + "]=" + j);
یه سواله دیگه هم داشتم درمورد this چه موقع استفاه می شه
namespace ex23
{
// a simple class to store in the array
public class
Employee
{
public
Employee(int empID)
{
this
.empID = empID;
}
سلام
من برنامه های c++ کتاب دایتل رو دارم مینویسم چند جا به اشکال برخورد کردم که برنامه هام جواب نمیدن ممنون میشم اگه راهنماییم کنید.
*برنامه ای بنویسید که یک عدد صحیح را بگیرد و مقدار ثابت ریاضی e را محاسبه کند:
e =1+ (1/1!) + (1/2!)+(1/3!)+…
البته من برنامه اش رو نوشتم ولی نمیدونم کجا اشتباه کردم که فقط یک چاپ میکنه:
Include< iostream.h>#
; main(){ int fact,i,n
; float sum,a
Sum=1;
fact=1;;
cout<<"enter number plz;"<<endl;
cin>>n;
For(i=n; i>=1; i--){
fact=fact*i;
a=1/fact
{sum=sum+a;
cout<<"sum:"<<sum;
اگه میشه لطف کنید و بگید با ویژوال C++ چه برنامه هایی رو میشه نوشت
و زبان چند نرم افزار معروف را بگید ممنون میشم![]()
سلام واقعا مهندسای این باشگاه هیچ کدوم نمی توننن به من توc#کمک کنن این مهندسای کامپیوترمنقرض شدن یاخیسسن!!!!!!!
من سوال داشتم درمورد علامت جمع توی کروشه قبل وبعد ازI
for
(int i=0 ; i< intData.Length ; i++)
{
int
j = intData;
Console.WriteLine("intData[" + i + "]=" + j);
یه سواله دیگه هم داشتم درمورد this چه موقع استفاه می شه
namespace ex23
{
// a simple class to store in the array
public class
Employee
{
public
Employee(int empID)
{
this
.empID = empID;
}
cout<<"Please enter your number for Analyze"<<endl;
int a, i=2, j, q=0;
cin>>a;
j=a%i;
for(; i<a+1 ; i++)
{
for(j=a%i; j==0 ;)
{
a=a/i;
if ( j==0 )
cout<<i<<"*";
j=a%i;
}
}
cout <<endl;
[LEFT][SIZE=3][FONT=Times New Roman]#Include< iostream.h>[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]main(){ [/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]int fact,i,n,a;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]float sum;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]Sum=0;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]cout<<"enter number plz;"<<endl;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]cin>>n;[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3][COLOR=blue][B]for (a=1;a<=n,a++)[/B][/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=blue][B]{[/B][/COLOR][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][COLOR=blue][B]fact=1;[/B][/COLOR][/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman][COLOR=red][B]For(i=n; i>=1; i--)[/B][/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman][COLOR=red][B]fact=fact*i;[/B][/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman][COLOR=blue][B]sum+=1/fact;[/B][/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman][COLOR=blue][B]} [/B][/COLOR][/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]cout<<"sum:"<<sum;[/FONT][/SIZE][/LEFT]
}
نه من که ظهر که داشتم امتحان میکردم..10 که بهش دادم 2 5 بهم داد...!!!!
25 که بهش دادم...5 5 داد..و 63 که دادم...3 3 7 بهم داد...
بازم الان امتحان می کنم...
سلامسلام معادل تابع (1) exit در ++cدر # c چی میشه؟
![]()
سلام
دربرنامه های Windows Application شما می توانید باتابع Application.Exit() ازبرنامه خارج شوید.
موفق باشید
[SIZE=2][COLOR=#0000ff]
while[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][SIZE=2])
{
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].Write([/SIZE][SIZE=2][COLOR=#800000]"\nEnter 1 for week."[/COLOR][/SIZE][SIZE=2]);
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].Write([/SIZE][SIZE=2][COLOR=#800000]"\nEnter 2 for sum."[/COLOR][/SIZE][SIZE=2]);
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].Write([/SIZE][SIZE=2][COLOR=#800000]"\nEnter 3 for show stars."[/COLOR][/SIZE][SIZE=2]);
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].Write([/SIZE][SIZE=2][COLOR=#800000]"\nEnter 4 for exit."[/COLOR][/SIZE][SIZE=2]);
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].Write([/SIZE][SIZE=2][COLOR=#800000]"\nEnter one number:"[/COLOR][/SIZE][SIZE=2]);
a = [/SIZE][SIZE=2][COLOR=#008080]Convert[/COLOR][/SIZE][SIZE=2].ToInt32([/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].ReadLine());
[/SIZE][SIZE=2][COLOR=#0000ff]switch[/COLOR][/SIZE][SIZE=2] (a)
{
[/SIZE][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][SIZE=2] 1: [/SIZE][SIZE=2][COLOR=#008080]week[/COLOR][/SIZE][SIZE=2] w1 = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]week[/COLOR][/SIZE][SIZE=2]();
w1.GetNumber();
w1.Show();
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].ReadLine();
[/SIZE][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][SIZE=2] 2: [/SIZE][SIZE=2][COLOR=#008080]sum[/COLOR][/SIZE][SIZE=2] s = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]sum[/COLOR][/SIZE][SIZE=2]();
s.GetIfo();
s.Sum();
s.Show();
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].ReadLine();
[/SIZE][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][SIZE=2] 3: [/SIZE][SIZE=2][COLOR=#008080]stars[/COLOR][/SIZE][SIZE=2] s1 = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#008080]stars[/COLOR][/SIZE][SIZE=2]();
s1.ShowStars();
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].ReadLine();
[/SIZE][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][SIZE=2] 4: [/SIZE][SIZE=2][COLOR=#008000]//ApplicationException();
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][SIZE=2];
[/SIZE][SIZE=2][COLOR=#0000ff]default[/COLOR][/SIZE][SIZE=2]: [/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].Write([/SIZE][SIZE=2][COLOR=#800000]"your number isnt corect."[/COLOR][/SIZE][SIZE=2]);
[/SIZE][SIZE=2][COLOR=#0000ff]break[/COLOR][/SIZE][SIZE=2];
}
[/SIZE][SIZE=2][COLOR=#008080]Console[/COLOR][/SIZE][SIZE=2].ReadLine();
}
[/SIZE]