Bonus2win Ethereum
Publish: 2021-04-18 12:38:51
1. / / this is a code segment for file ing and capitalization of lowercase. Make complaints about the fastest answer to the problem. So many, dizzy, writing may not be good, there is anything you don't understand, you can continue to ask
#include
#include
#include
int main (void) {
int ch// Define a character variable to store a character of the file as an intermediate variable,
file * source, * destination// Define two file pointers, but do not point to any file for the time being
char source_ name[41],destination_ name[41]; // Define two character arrays to store the source file name and destination file name
printf & quot; input the source file' s name:"); // The output prompt information requires the input of the source file name
if ((source = fopen (gets (source = fopen))_ name)," r")) == Null) / / get the input source file name, and open it with fopen read permission. If the open fails, return null pointer, output failure prompt, and exit
{
printf & quot; Can' t open %s\ n", source_ name); exit(1); < br />}
printf(" input the destination file' s name:"); // The output prompt information requires the input of the destination file name
if ((destination = fopen (gets (destination))_ name)," w")) == Null) / / get the input destination file name, and open it with fopen write permission. If it fails to open, return null pointer, output failure prompt, and exit
{
printf & quot; Can' t open %s\ n", destination_ name); exit(1); < br />}
while ((ch = getc(source)) != EOF) / / loop to get the characters in the source file until the end of the file is met. EOF exits the loop
putc (toupper (CH), destination)// Convert the acquired characters into uppercase and input them into the target file
Fclose (source)// Close the source file pointer
Fclose (destination)// Close the destination file pointer
printf & quot; finished\ n"); // Prompt end
return 0// That's all. Why don't you continue to ask
}
#include
#include
#include
int main (void) {
int ch// Define a character variable to store a character of the file as an intermediate variable,
file * source, * destination// Define two file pointers, but do not point to any file for the time being
char source_ name[41],destination_ name[41]; // Define two character arrays to store the source file name and destination file name
printf & quot; input the source file' s name:"); // The output prompt information requires the input of the source file name
if ((source = fopen (gets (source = fopen))_ name)," r")) == Null) / / get the input source file name, and open it with fopen read permission. If the open fails, return null pointer, output failure prompt, and exit
{
printf & quot; Can' t open %s\ n", source_ name); exit(1); < br />}
printf(" input the destination file' s name:"); // The output prompt information requires the input of the destination file name
if ((destination = fopen (gets (destination))_ name)," w")) == Null) / / get the input destination file name, and open it with fopen write permission. If it fails to open, return null pointer, output failure prompt, and exit
{
printf & quot; Can' t open %s\ n", destination_ name); exit(1); < br />}
while ((ch = getc(source)) != EOF) / / loop to get the characters in the source file until the end of the file is met. EOF exits the loop
putc (toupper (CH), destination)// Convert the acquired characters into uppercase and input them into the target file
Fclose (source)// Close the source file pointer
Fclose (destination)// Close the destination file pointer
printf & quot; finished\ n"); // Prompt end
return 0// That's all. Why don't you continue to ask
}
2. This guy's code quality is so poor, and the variable name defined has certain randomness, so there's no reason to
as for multiplying by 0.75, I think it's wrong
don't use garbage code to learn, this kind of code is very poor
as for multiplying by 0.75, I think it's wrong
don't use garbage code to learn, this kind of code is very poor
Hot content
