ציטוט:
נכתב במקור על ידי Matchs
גרסא 1.6 בטא, בקרוב אני אתן בו בלי הגבלה של מספרים (כרגע יש 2).
הקוד מקור:
PHP קוד:
#include <iostream.h> #include <conio.h>
// This program By Rotem. // All copy-right to me © 2006. // Calculate in C++, Version 1.6 Beta! int main() { float x, y; char action; cout<<"Welcome to my calculate - Version 1.6 Beta!"; cout<<"\nI hope that you use in it for test.."; cout<<"\n\nPlease input the first number: "; cin>>x; cout<<"Please input the second number: "; cin>>y; cout<<"Please select action (+, -, /, *): "; cin>>action; switch(action) { case '+': cout << x << "+" << y << " = " << x+y; break; case '-': cout << x << "-" << y << " = " << x-y; break; case '/': cout << x << ":" << y << " = " << x/y; break; case '*': cout << x << "*" << y << " = " << x*y; break; } cout<<"\n\nThis program by Rotem (c) 2006!"; cout<<"\nWant a some program? So learn C++ ;)"; getch(); return 0; }
ולינק לתוכנה מקומפלת (ע"י Dev-C++): http://rapidshare.de/files/12104274/calculate.exe.html.
תהנו,
Matchs.
|
לא בדקתי אבל יש לי קוד דומה...הייתה לנו שאלה באחד מדפי העבודה שצריך לעשות מחשבון...
בכל מקרה....זה ממש קל..אבל נחמד לראות פה עוד אנשים שעוסקים בC :]..