#4319
Se dă un șir cu n
elemente, numere naturale. Să se determine câte elemente ale șirului conțin cifra 0
.
Problema | Cifre21 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #43729286 | Utilizator | |
Fișier | cifre21.cpp | Dimensiune | 1.34 KB |
Data încărcării | 12 Mai 2023, 11:52 | Scor / rezultat | Eroare de compilare |
cifre21.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ cifre21.cpp:1:7: error: 'System' has not been declared cifre21.cpp:10:20: error: expected ':' before 'int' public int PrimaCif(int n) ^ cifre21.cpp:16:20: error: expected ':' before 'int' public int SumaCif(int n) ^ cifre21.cpp:26:20: error: expected ':' before 'bool' public bool cifzero(int n) ^ cifre21.cpp:35:9: error: expected ';' after class definition } ^ cifre21.cpp:36:26: error: 'string' has not been declared static void Main(string[] args) ^ cifre21.cpp:36:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ cifre21.cpp:56:5: error: expected ';' after class definition } ^ cifre21.cpp: In static member function 'static void ConsoleApp1::Program::Main(int*)': cifre21.cpp:38:16: error: expected unqualified-id before '[' token int[] a = new int[100]; ^ cifre21.cpp:40:17: error: expected primary-expression before 'int' n = int.Parse(Console.ReadLine()); ^ cifre21.cpp:40:17: error: expected ';' before 'int' cifre21.cpp:41:13: error: 'string' was not declared in this scope string linie = Console.ReadLine(); ^ cifre21.cpp:41:20: error: expected ';' before 'linie' string linie = Console.ReadLine(); ^ cifre21.cpp:42:20: error: expected primary-expression before ']' token string[] s = linie.Split(' '); ^ cifre21.cpp:42:22: error: expected ';' before 's' string[] s = linie.Split(' '); ^ cifre21.cpp:43:29: error: expected ')' before 'nr' foreach (string nr in s) ^ cifre21.cpp:43:36: error: 'foreach' was not declared in this scope foreach (string nr in s) ^ cifre21.cpp:44:17: error: expected ';' before 'a' a[++i] = int.Parse(nr); ^ cifre21.cpp:46:33: error: conversion from 'ConsoleApp1::Program::Cifre*' to non-scalar type 'ConsoleApp1::Program::Cifre' requested Cifre c = new Cifre(); ^ cifre21.cpp:50:31: error: 'a' was not declared in this scope if (c.cifzero(a[i]) == true) ^ cifre21.cpp:54:13: error: 'Console' was not declared in this scope Console.Write(cnt); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cifre21 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.