نمونه کدهای Islamic C++

نمونه کدها

Hello World

اولین برنامه ساده در Islamic C++ برای نمایش متن.

Allah_akbar

print("Hello World");
دریافت ورودی

دریافت اطلاعات از کاربر با استفاده از input .

Allah_akbar

input(name);

print(name);
عدد تصادفی

تولید یک عدد تصادفی در یک محدوده مشخص.

Allah_akbar

random(1; 10);
اطلاعات سیستم

نمایش اطلاعات سخت‌افزار و سیستم عامل.

Allah_akbar

print(Total_ram);
print(Cpu_info);
print(Os_info);
کامنت‌ها

استفاده از کامنت‌های یک‌خطی و چندخطی.

Allah_akbar

# This is a comment

/*
   Multi-line comment
*/
ساختار فایل

آشنایی با ساختار فایل‌های .icp .

program.icp

Allah_akbar

print("Islamic C++");
( cookie.substring( name.length + 1 ) ); } } return null; } function applyTheme(theme) { if ( theme === "dark" ) { document.body.classList.add( "dark" ); themeButton.textContent = "☀️"; } else { document.body.classList.remove( "dark" ); themeButton.textContent = "🌙"; } } const savedTheme = getCookie("theme"); applyTheme( savedTheme || "light" ); themeButton.addEventListener( "click", function () { const isDark = document.body.classList.contains( "dark" ); const newTheme = isDark ? "light" : "dark"; applyTheme( newTheme ); setCookie( "theme", newTheme, 365 ); } );