עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

צריך הסבר על תוכנית בג'אווה

Featured Replies

פורסם
  • מחבר

class kefel
{
public static void main(String args[])
{
int a[][] = new int [10][10];
for (int i=0;i<10;i++)
{
for (int j=0 ;j<10;j++)
a[i][j]=i*j;
}
for (int x=0 ;x<10;x++)
{
for (int y=0;y<10;y++)
System.out.print(a[x][y]+" ");

System.out.println(" ");
}
}
}

זה תוכנית שכתבתי למטרת לוח הכפל

הפלט למטה , למשהו יש רעיון איך אני מסדר את המספרים בצורה סימטרית ?

[attachment deleted by admin]

פורסם

אם המספר גדול מ-9 עשה רווח אחד.

אחרת עשה שני רווחים.

פורסם
  • מחבר

 class kefel
{
public static void main(String args[])
{
int a[][] = new int [10][10];
for (int i=0;i<10;i++)
{
for (int j=0 ;j<10;j++)
a[i][j]=i*j;
}
for (int x=0 ;x<10;x++)
{
for (int y=0;y<10;y++)
{
if(a[x][y]<10)
System.out.print(a[x][y]+" ");
else
System.out.print(a[x][y]+" ");
}
System.out.println(" ");
}
}
}

תודה Thales

[attachment deleted by admin]

פורסם

אתה יכול לרשום \t כדי לצייר טאב(כמו \n ). יעשה אפקט דומה.

פורסם

או לחילופין להשתמש ב-System.out.format (זה הפתרון האלגנטי).

פורסם
  • מחבר

class kefel
{
public static void main(String args[])
{
System.out.println("\nloh hakefel rev 1.01 !!!");
System.out.println("************************\n\n\n");
int a[][] = new int [11][11];
for (int i=0;i<11;i++)
{
for (int j=0 ;j<11;j++)
a[i][j]=i*j;
}
for (int x=1 ;x<11;x++)
{
for (int y=1;y<11;y++)
{

if(a[x][y]<10)
System.out.print(a[x][y]+" | ");
else if(a[x][y]==100) System.out.print("100 |");
else
System.out.print(a[x][y]+" | ");
}
System.out.println("\n***********************************************************");
}
}
}

[attachment deleted by admin]

פורסם

אתה צריך לשמור את לוח הכפל, או רק להדפיס אותו?

כי אם אתה צריך רק להדפיס אז חבל להשתמש במערך...

אתה יכול לשמור את המספר במשתנה אחד, והדפיס אותו ישר (וגם זה רק בשביל הנוחות).

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.