小编Kir*_*lve的帖子

“无法检测帖子媒体类型。跳过” InstaPy 机器人不与帖子互动

我正在尝试为 instapy 编写一个代码,以便通过标签对帖子进行点赞和评论。它显示标签页面但不与帖子交互。我的代码:

session = InstaPy(username, password)                               
session.login()                                                                          
session.set_relationship_bounds(enabled=True,max_followers=200)                          
session.set_do_follow(True,percentage=100)                                               
session.like_by_tags(["indiemusic", "heartbreakanniversary"], amount=5,interact=True)      
session.set_dont_like(["naked", "nsfw"])                                                 
session.set_do_follow(True, percentage=50)                                               
session.set_do_comment(True, percentage=50)                                              
session.set_comments(["Nice!", "S`weet!", "Beautiful :heart_eyes:"])                      
session.set_user_interact(amount=1,randomize=True,percentage=100)                        
session.end()                                                                                         
Run Code Online (Sandbox Code Playgroud)

python instapy

1
推荐指数
1
解决办法
4798
查看次数

将第 k 个元素打印到链表中的最后一个元素的算法

我正在阅读 Cracking the Coding Interview 并做练习题,但我一直坚持这个问题:

“实现一种算法来查找单向链表的第 k 个到最后一个元素。”

我的递归函数没有返回任何东西,我不知道为什么。在递归函数中,我采用了 3 个参数。K将是我们想要找出的最后一个元素的位置。Node* temp将是头节点, int i 将保留最后一个节点的元素计数。

#include<bits/stdc++.h>
using namespace std;

class Node
{
    int data;
    Node* next;
    public:
    Node(){
        data=0;
        next=NULL;
    }

    friend class LinkedList;
};

class LinkedList
{
    public:
    Node* head;
    public:
    LinkedList(){
        head=NULL;
    }

    void append(int data){
        Node* temp= new Node();
        temp->data=data;
        temp->next=NULL;
    
        if (head==NULL){
            head=temp;
            
        }
        else{
        Node* ptr=head;
        while(ptr->next!=NULL){
            ptr=ptr->next;
        }
        ptr->next=temp;
        }

    }

    void display(){
        Node* ptr=head;
        if(head==NULL){
            cout<<"List is empty"<<endl; …
Run Code Online (Sandbox Code Playgroud)

c++ linked-list singly-linked-list

-1
推荐指数
1
解决办法
96
查看次数

标签 统计

c++ ×1

instapy ×1

linked-list ×1

python ×1

singly-linked-list ×1