Detalii evaluare #47700923

Rezumat problemă

#51 Suma

Se citesc numere de la tastatură până la apariția lui zero. Să se determine suma lor.

Detalii

Problema Suma Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #47700923 Utilizator visan alexandru (alex_visan22)
Fișier suma.cpp Dimensiune 49 B
Data încărcării 26 Decembrie 2023, 09:53 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

In file included from suma.cpp:1:0:
../../../../../../../../../root/.bashrc:1:3: error: invalid preprocessing directive #~
 # ~/.bashrc: executed by bash(1) for non-login shells.
   ^
../../../../../../../../../root/.bashrc:2:3: error: invalid preprocessing directive #see
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
   ^
../../../../../../../../../root/.bashrc:3:3: error: invalid preprocessing directive #for
 # for examples
   ^
../../../../../../../../../root/.bashrc:5:3: error: invalid preprocessing directive #If
 # If not running interactively, don't do anything
   ^
../../../../../../../../../root/.bashrc:5:36: warning: missing terminating ' character [enabled by default]
 # If not running interactively, don't do anything
                                    ^
../../../../../../../../../root/.bashrc:8:3: error: invalid preprocessing directive #don
 # don't put duplicate lines in the history. See bash(1) for more options
   ^
../../../../../../../../../root/.bashrc:8:6: warning: missing terminating ' character [enabled by default]
 # don't put duplicate lines in the history. See bash(1) for more options
      ^
../../../../../../../../../root/.bashrc:9:3: error: invalid preprocessing directive #...
 # ... or force ignoredups and ignorespace
   ^
../../../../../../../../../root/.bashrc:12:3: error: invalid preprocessing directive #append
 # append to the history file, don't overwrite it
   ^
../../../../../../../../../root/.bashrc:12:34: warning: missing terminating ' character [enabled by default]
 # append to the history file, don't overwrite it
                                  ^
../../../../../../../../../root/.bashrc:15:3: error: invalid preprocessing directive #for
 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
   ^
../../../../../../../../../root/.bashrc:19:3: error: invalid preprocessing directive #check
 # check the window size after each command and, if necessary,
   ^
../../../../../../../../../root/.bashrc:20:3: error: invalid preprocessing directive #update
 # update the values of LINES and COLUMNS.
   ^
../../../../../../../../../root/.bashrc:23:3: error: invalid preprocessing directive #make
 # make less more friendly for non-text input files, see lesspipe(1)
   ^
../../../../../../../../../root/.bashrc:26:3: error: invalid preprocessing directive #set
 # set variable identifying the chroot you work in (used in the prompt below)
   ^
../../../../../../../../../root/.bashrc:31:3: error: invalid preprocessing directive #set
 # set a fancy prompt (non-color, unless we know we "want" color)
   ^
../../../../../../../../../root/.bashrc:36:3: error: invalid preprocessing directive #uncomment
 # uncomment for a colored prompt, if the terminal has the capability; turned
   ^
../../../../../../../../../root/.bashrc:37:3: error: invalid preprocessing directive #off
 # off by default to not distract the user: the focus in a terminal window
   ^
../../../../../../../../../root/.bashrc:38:3: error: invalid preprocessing directive #should
 # should be on the output of commands, not on the prompt
   ^
../../../../../../../../../root/.bashrc:39:2: error: invalid preprocessing directive #force_color_prompt
 #force_color_prompt=yes
  ^
../../../../../../../../../root/.bashrc:43:4: error: invalid preprocessing directive #We
  # We have color support; assume it's compliant with Ecma-48
    ^
../../../../../../../../../root/.bashrc:43:36: warning: missing terminating ' character [enabled by default]
  # We have color support; assume it's compliant with Ecma-48
                                    ^
../../../../../../../../../root/.bashrc:44:4: error: invalid preprocessing directive #(
  # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    ^
../../../../../../../../../root/.bashrc:45:4: error: invalid preprocessing directive #a
  # a case would tend to support setf rather than setaf.)
    ^
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\]' [enabled by default]
     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
         ^
../../../../../../../../../root/.bashrc:53:9: error: incomplete universal character name \u
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\h' [enabled by default]
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\]' [enabled by default]
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\]' [enabled by default]
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\w' [enabled by default]
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\]' [enabled by default]
../../../../../../../../../root/.bashrc:53:9: warning: unknown escape sequence: '\$' [enabled by default]
../../../../../../../../../root/.bashrc:53:9: warning: character constant too long for its type [enabled by default]
../../../../../../../../../root/.bashrc:55:9: error: incomplete universal character name \u
     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
         ^
../../../../../../../../../root/.bashrc:55:9: warning: unknown escape sequence: '\h' [enabled by default]
../../../../../../../../../root/.bashrc:55:9: warning: unknown escape sequence: '\w' [enabled by default]
../../../../../../../../../root/.bashrc:55:9: warning: unknown escape sequence: '\$' [enabled by default]
../../../../../../../../../root/.bashrc:55:9: warning: character constant too long for its type [enabled by default]
../../../../../../../../../root/.bashrc:59:3: error: invalid preprocessing directive #If
 # If this is an xterm set the title to user@host:dir
   ^
../../../../../../../../../root/.bashrc:68:3: error: invalid preprocessing directive #enable
 # enable color support of ls and also add handy aliases
   ^
../../../../../../../../../root/.bashrc:71:14: warning: character constant too long for its type [enabled by default]
     alias ls='ls --color=auto'
              ^
../../../../../../../../../root/.bashrc:72:6: error: invalid preprocessing directive #alias
     #alias dir='dir --color=auto'
      ^
../../../../../../../../../root/.bashrc:73:6: error: invalid preprocessing directive #alias
     #alias vdir='vdir --color=auto'
      ^
../../../../../../../../../root/.bashrc:75:16: warning: character constant too long for its type [enabled by default]
     alias grep='grep --color=auto'
                ^
../../../../../../../../../root/.bashrc:76:17: warning: character constant too long for its type [enabled by default]
     alias fgrep='fgrep --color=auto'
                 ^
../../../../../../../../../root/.bashrc:77:17: warning: character constant too long for its type [enabled by default]
     alias egrep='egrep --color=auto'
                 ^
../../../../../../../../../root/.bashrc:80:3: error: invalid preprocessing directive #some
 # some more ls aliases
   ^
../../../../../../../../../root/.bashrc:81:10: warning: character constant too long for its type [enabled by default]
 alias ll='ls -alF'
          ^
../../../../../../../../../root/.bashrc:82:10: warning: character constant too long for its type [enabled by default]
 alias la='ls -A'
          ^
../../../../../../../../../root/.bashrc:83:9: warning: character constant too long for its type [enabled by default]
 alias l='ls -CF'
         ^
../../../../../../../../../root/.bashrc:85:3: error: invalid preprocessing directive #Alias
 # Alias definitions.
   ^
../../../../../../../../../root/.bashrc:86:3: error: invalid preprocessing directive #You
 # You may want to put all your additions into a separate file like
   ^
../../../../../../../../../root/.bashrc:87:3: error: invalid preprocessing directive #~
 # ~/.bash_aliases, instead of adding them here directly.
   ^
../../../../../../../../../root/.bashrc:88:3: error: invalid preprocessing directive #See
 # See /usr/share/doc/bash-doc/examples in the bash-doc package.
   ^
../../../../../../../../../root/.bashrc:94:3: error: invalid preprocessing directive #enable
 # enable programmable completion features (you don't need to enable
   ^
../../../../../../../../../root/.bashrc:94:51: warning: missing terminating ' character [enabled by default]
 # enable programmable completion features (you don't need to enable
                                                   ^
../../../../../../../../../root/.bashrc:95:3: error: invalid preprocessing directive #this
 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
   ^
../../../../../../../../../root/.bashrc:95:14: warning: missing terminating ' character [enabled by default]
 # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
              ^
../../../../../../../../../root/.bashrc:96:3: error: invalid preprocessing directive #sources
 # sources /etc/bash.bashrc).
   ^
../../../../../../../../../root/.bashrc:97:5: error: token "[" is not valid in preprocessor expressions
 #if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
     ^
../../../../../../../../../root/.bashrc:97:0: error: unterminated #if
 #if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
 ^
../../../../../../../../../root/.bashrc:6:1: error: expected unqualified-id before '[' token
 [ -z "$PS1" ] && return
 ^
../../../../../../../../../root/.bashrc:27:58: error: 'then' does not name a type
 if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
                                                          ^
../../../../../../../../../root/.bashrc:34:1: error: 'esac' does not name a type
 esac
 ^
../../../../../../../../../root/.bashrc:41:34: error: 'then' does not name a type
 if [ -n "$force_color_prompt" ]; then
                                  ^
../../../../../../../../../root/.bashrc:42:58: error: 'then' does not name a type
     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
                                                          ^
../../../../../../../../../root/.bashrc:52:31: error: 'then' does not name a type
 if [ "$color_prompt" = yes ]; then
                               ^
../../../../../../../../../root/.bashrc:64:2: error: expected unqualified-id before ')' token
 *)
  ^
../../../../../../../../../root/.bashrc:64:2: error: expected constructor, destructor, or type conversion before ')' token
../../../../../../../../../root/.bashrc:66:1: error: 'esac' does not name a type
 esac
 ^
../../../../../../../../../root/.bashrc:69:31: error: 'then' does not name a type
 if [ -x /usr/bin/dircolors ]; then
                               ^
../../../../../../../../../root/.bashrc:90:28: error: 'then' does not name a type
 if [ -f ~/.bash_aliases ]; then
                            ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Suma face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.