تفاوت دو نسخهٔ متفاوت از صفحه را مشاهده میکنید.
نگارش قبل در دو طرف نگارش قبل | نگارش بعد نگارش بعد در دو طرف | ||
آماده_سازی:برنامه_ی_نمونه [2018/11/29 17:16] حمید ضرابی زاده [کدهای نمونه] |
آماده_سازی:برنامه_ی_نمونه [2019/11/07 16:35] حمید ضرابی زاده |
||
---|---|---|---|
خط 37: | خط 37: | ||
- | ==== زبان سی ==== | + | ==== زبان سی++ ==== |
- | <code c area.c> | + | <code cpp area.cpp> |
- | #include <stdio.h> | + | #include <iostream> |
+ | using namespace std; | ||
int main() { | int main() { | ||
int n, area; | int n, area; | ||
- | scanf("%d", &n); | + | cin >> n; |
area = n * n; | area = n * n; | ||
- | printf("%d\n", area); | + | cout << area << endl; |
return 0; | return 0; | ||
} | } | ||
</code> | </code> | ||
- | ==== زبان سی++ ==== | ||
- | <code cpp area.cpp> | + | ==== زبان سی ==== |
- | #include <iostream> | + | |
- | using namespace std; | + | <code c area.c> |
+ | #include <stdio.h> | ||
int main() { | int main() { | ||
int n, area; | int n, area; | ||
- | cin >> n; | + | scanf("%d", &n); |
area = n * n; | area = n * n; | ||
- | cout << area << endl; | + | printf("%d\n", area); |
return 0; | return 0; | ||
} | } |