编程介的小学生 2019-06-04 21:53 采纳率: 20.5%
浏览 201

射线和圆的相交的计算的问题,是如何利用C语言的程序的代码的编写的技术的方式实现的

Problem Description
Beads of red, blue or green colors are connected together into a circular necklace of n beads ( n < 40 ). If the repetitions that are produced by rotation around the center of the circular necklace or reflection to the axis of symmetry are all neglected, how many different forms of the necklace are there?

Input
The input has several lines, and each line contains the input data n.
-1 denotes the end of the input file.

Output
The output should contain the output data: Number of different forms, in each line correspondent to the input data.

Sample Input
4
5
-1

Sample Output
21
39

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
    • ¥15 MCNP里如何定义多个源?
    • ¥20 双层网络上信息-疾病传播
    • ¥50 paddlepaddle pinn
    • ¥20 idea运行测试代码报错问题
    • ¥15 网络监控:网络故障告警通知
    • ¥15 django项目运行报编码错误
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏