4 תשובות
יש אסקי בגאבה?
package test;
import java.util.*;
public class ifcharisab (
static scanner reader=new scanner (system.in);
//input:the function gets a character
//output:he function returns true if the character is in the abc
public static boolean isabc (char ch) (
if ( (ch >= 'a' && ch <= 'z') || (ch >= 'a' && ch <= 'z')) (
return true;
)
return false;
)
public static void main (string args ())
(
system.out.println ("enter a character");
char ch=reader.next ().charat (0);
if (isabc (ch))
system.out.println ("the character is in the abc");
else (
system.out.println ("the character is not in the abc");
)
)
)
זה בגאוה אבל בגאוה סקריפט זה כמעט אותו הדבר, עובד על אותו עיקרון ויש עוד הרבה דרכים לבדוק אם זה מאותיות הabc אפשר להשתמש בregex או במספרים של האותיות אבל זאת שיטה פשוט די פשוטה אם תרצי אני יכולה להראות עוד שיטות
שואל השאלה:
תודה אבל זה לעבודה וזה צריך להיות עם document write וזה וחייב javascript

: (
אנונימית
זה יהיה אותו דבר פשוט עם document.write
function isinabc (char ch)
(
if ( (ch >= 'a' && ch <= 'z') || (ch >= 'a' && ch <= 'z'))
(
document.write ("the character is in the abc");
)
else
(
document.write ("the character isn't in the abc");
)
)