עבור לתוכן
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.

ג'אווה. שוני בפלט בין cmd לבין הקונסולה בeclipse.

Featured Replies

פורסם

שלום,

כתבתי קוד הממש מחשבון בשפת גאווה.

כאשר אני מכניס קלט דרך ה-eclipse הפלט יוצא נכון וכמו שצריך, גם כאשר אני מריץ את התכנית דרך ה-cmd הפלט יוצא נכון אם הקלט הוא דרך המקלדת, אך כאשר אני מכניס את אותו הקלט דרך קובץ יוצא פלט שונה, מצורף קובץ תמונה של ה-cmd והקובץ ממנו נלקח הקלט.

פורסם

עשית Debug?? אם לא, תעשה!

משהו בפונקציית קריאת הנתונים מהקובץ שלך לא עובד טוב...

כמובן שלא פירסמת את הקוד לכן לא נוכל לעזור לעומק

פורסם
  • מחבר

מצורף קטע הקוד האחראי על קליטת הנוסחה והפיכתה למערך מספרים וסימנים.

import java.util.Scanner;

public class ArithmeticApp
{


public static void main(String[] args)
{
int i=0,a=0,flag=0,cntIndx=0,size=0,j=0;
String strNums = new String();
String boot = new String();
char check;
Scanner input = new Scanner (System.in);
System.out.println("Please Enter Expression:\n");
String str = input.nextLine();
double[]num=new double [str.length()];
char[]signs=new char [str.length()];
size=str.length();
System.out.printf("The Value of Expression ");
while(i<=size)
{
check=str.charAt(i);
if(check=='-' && i==0)
{
while(a==0)
{
if(((check<'0' || check>'9') && check!='.' && check!='-') || i>size-1 || check==' ')
break;
i++;
strNums=strNums+check;
if(((check<'0' || check>'9') && check!='.' && check!='-') || i>size-1 || check==' ')
break;
check=str.charAt(i);
}
num[cntIndx]=Double.parseDouble(strNums);
}
else
{
while(a==0)
{
if(((check<'0' || check>'9') && check!='.') || i>size-1 || check==' ')
break;
if(flag==0)
{
strNums=boot;
flag++;
}
i++;
strNums=strNums+check;
if(((check<'0' || check>'9') && check!='.') || i>size-1 || check==' ')
break;
check=str.charAt(i);
}
flag=0;
num[cntIndx]=Double.parseDouble(strNums);
}
if(i>=size)
break;
if(check==' ')
i++;
signs[cntIndx]=str.charAt(i);
i++;
check=str.charAt(i);
if (check==' ')
i++;
cntIndx++;

פורסם

תדפיס את str אחרי שאתה קורא את השורה הבאה

פורסם
  • מחבר

הסתדרתי, מספר הרווחים לא היה חייב להיות אחד ומכאן הטעות תודה לכל העוזרים.

ארכיון

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

דיונים חדשים

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.