Home > Back-end >  C language programming topics for help thank you!
C language programming topics for help thank you!

Time:09-22

In view of the present telephone users are often waste the status quo of telephone harassment, launched on the market all kinds of garbage telephone interception software, here try to achieve the function of intercept rubbish phone software part, main implementation calls for judgment, determine whether to intercept the calls, we take the rubbish phone decision rule is: or is in the blacklist or begin with 400, blacklist can be defined as global pointer array, write two custom function, the function of a custom function is whether a numeric string starting with 400, another custom function function is to determine whether a numeric string in the blacklist, the main function is responsible for enter a phone number, and then call the custom function respectively to determine the number, whether to need to be intercepted and output the number of information,

CodePudding user response:

This is clear, to achieve two functions, first determines if the beginning of 400, to judge the first three characters respectively 0, 4, another function is the search function, is to find the number in the blacklist, you can use linked lists to store the blacklist, if simple, can also be an array

CodePudding user response:

reference 1/f, Simple, Soft reply:
this is clear, realize the two functions, first determines if the beginning of 400, to judge the first three characters respectively 0, 4, another function is the search function, is to find the number in the blacklist, you can use linked lists to store the blacklist, if Simple, can also be an array to store
how input a string of Numbers only let him judge the first three

CodePudding user response:

Int n, a [105], CNT=0;
While (n) {
A [+ + CNT]=n % 10;
N/a=10;
}

CodePudding user response:

Get a array is n every, is just the reverse

CodePudding user response:

A string of Numbers can be a string, so that we can take out the first three characters
  • Related