5 תשובות
איזה שפה?
אנונימי
public static scanner input = new scanner(system.in);
public static void main(string[] args) {
int[] nums = new int[50];
for(int i = 0; i<50; i++)
nums[i]=input.nextint();
int counter = 0;
for (int i = 0; i<50; i++) {
if (nums[i]%2==0)
counter++
}
system.out.println(counter);
}
public static void main(string[] args) {
int[] nums = new int[50];
for(int i = 0; i<50; i++)
nums[i]=input.nextint();
int counter = 0;
for (int i = 0; i<50; i++) {
if (nums[i]%2==0)
counter++
}
system.out.println(counter);
}
שואל השאלה:
אני לא למדתי עדיין חצי מהדברים בקוד אני בכיתה י והתחלתי היום ללמוד את לולאת for אפשר שתרשמו בדברים שמתאימים לרמה הזאת בבקשה
אני לא למדתי עדיין חצי מהדברים בקוד אני בכיתה י והתחלתי היום ללמוד את לולאת for אפשר שתרשמו בדברים שמתאימים לרמה הזאת בבקשה
אנונימית
שואל השאלה:
ובגוואה
ובגוואה
אנונימית
public static scanner input = new scanner(system.in);
public static void main(string[] args) {
int counter = 0;
for(int i = 0; i<50; i++) {
int num = input.nextint();
if (num%2==0)
counter++
}
system.out.println(counter);
}
public static void main(string[] args) {
int counter = 0;
for(int i = 0; i<50; i++) {
int num = input.nextint();
if (num%2==0)
counter++
}
system.out.println(counter);
}
באותו הנושא: