※スタイルシート未対応ブラウザではレイアウトを正確に再現できません。
  > | advanced by | contents  | that returns in <    
                   < [modosusu] > Color magazine monochrome light and shade   font predetermined, Gothic Ming-style type longhand   size Konaka large   standard  


  Fear of input   

  1. ..clause 1..: Inputting error of fear
  2. ..clause 2..: Mistake of separator
  3. ..clause 3..: Too large numerical value
  4. ..clause 4..: Fear of character string
  5. ..clause 5..: About the solution

[1] Inputting error of fear

No do be known whether the author is a considerable sourpuss possibly either.
Though it introduces like the sample of a good program in the foregoing paragraph
It is hereafter because the complaint will be made when in the program, there is a problem.

On earth, where of the program ahead was the problem?
Actually, it is a problem to use the scanf function.

The scanf function is a function where it has various problems.
It is not used in real development in the introduction though it is used comparatively well.
The scanf function ban might been put out according to the company (school).

However, the program that had been made ahead operated especially without trouble.
On earth, the problem is where or ・・・・ and it are the inputting errors.

Though the scanf function doesn't especially cause the problem as long as it correctly uses it
At once, the dire problem might be caused when there is an inputting error.
It introduces the program like late in the future and it introduces the case with the inputting error to the theme.

It returns to contents.


[2] Mistake of separator

As the example that seems to happen first of all, it must strike and it is necessary to make a mistake in the separator.
Though it ..[de] district.. switched off in the program ahead
I want to delimit it in space daring to disregard this.

The following are the execution results for strike and make a mistake in the separator.


Delimit minimum value and the maximum value and input it. :100 200
100-307, Total.
It input it to the start Though 100 was normally input
200 : why It becomes a numerical value such as 307.

Because this result is different depending on the compiler used
Another result might come out when you have them execute it.

It returns to contents.


[3] Too large numerical value

Next, I want to input an extremely big numerical value.
Because a recent compiler can be input even by a considerably big numerical value
Use 16 bit compiler (LSI C-86) when you try this for myself.

The following are the execution results when a too large numerical value is input.


Delimit minimum value and the maximum value and input it. :1,70000
1-4464, Total.
Though it is necessary to have input 70000 why It is recognized 4464.
Moreover, it is too small as long as it even very thinks about the answer for the total value of 1-4464.

These are problems of happening because the limit within the range that can be memorized has been exceeded.
To the input variable to check the input With 4464 because it is substituted
It must strike, it is necessary to make a mistake in whether you wanted to put 4464, and Whether it became 4464 cannot be distinguished.

It returns to contents.


[4] Fear of character string

I want to experiment a heaven in addition dishonesty [oni].
That is, input the character string though it is said that input the numerical value.

The following are the execution results when the character string is input.


Delimit minimum value and the maximum value and input it. :ABCDEF
11975-307, Total.
[Mecchakuchadesu] already. The author doesn't understand to have become it so why either.
Where has the numerical value come out about 307?
Naturally, whether this numerical value was input or is an inputting error cannot be distinguished.

Though the person who surely violates [manuke] ..so.. might think that you are not ..you..
It might be half asleep, and a pet cat might trample down the keyboard.
In addition, the virus and the hacker occasionally input it unfortunately like this.
When such a situation happens because of the program used in the big enterprise and the government.

It returns to contents.


[5] About the solution

It is likely already to have become tired negligently being severely shown various inputting errors.
If the solution is not presented, you might be disgusted slowly, too.

However, the solution of this problem is not actually easy.
At least, this cannot be solved by your present knowledge.
The solution inputs as a character string, and the method of analyzing the data is general.
In a word, this problem to the solution though it is necessary to know the method of the string manipulation
The character string cannot be processed by your present knowledge.

It will introduce the means for solving the problems of this problem for a long time afterwards.
Till then, there is only keeping using the scanf function because there is no other way.
Meanwhile, take care about the inputting error earnestly.

It returns to contents.


< - It is advanced -> | in | head that returns  to returning  next |.